2017-10-26 18:57:39 +02:00
|
|
|
<basePages:LayoutAwarePageBase
|
2017-09-10 13:49:11 -04:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2017-09-27 18:01:21 +02:00
|
|
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
2017-10-26 18:57:39 +02:00
|
|
|
xmlns:controls="using:ModernKeePass.Controls"
|
|
|
|
xmlns:basePages="using:ModernKeePass.Pages.BasePages"
|
|
|
|
x:Class="ModernKeePass.Pages.MainPage"
|
|
|
|
x:Name="PageRoot"
|
|
|
|
mc:Ignorable="d">
|
2017-09-27 18:01:21 +02:00
|
|
|
<Page.Resources>
|
|
|
|
<CollectionViewSource
|
|
|
|
x:Name="MenuItemsSource"
|
2017-10-03 16:06:49 +02:00
|
|
|
Source="{Binding MainMenuItems}"
|
|
|
|
IsSourceGrouped="True" />
|
2017-09-27 18:01:21 +02:00
|
|
|
</Page.Resources>
|
2017-09-10 13:49:11 -04:00
|
|
|
|
2017-10-26 18:57:39 +02:00
|
|
|
<Page.Background>
|
|
|
|
<StaticResource ResourceKey="ApplicationPageBackgroundThemeBrush"/>
|
|
|
|
</Page.Background>
|
|
|
|
<Page.DataContext>
|
|
|
|
<viewModels:MainVm />
|
|
|
|
</Page.DataContext>
|
|
|
|
|
|
|
|
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
|
|
|
<Grid.ChildrenTransitions>
|
|
|
|
<TransitionCollection>
|
|
|
|
<EntranceThemeTransition/>
|
|
|
|
</TransitionCollection>
|
|
|
|
</Grid.ChildrenTransitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="70"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
2017-09-15 15:58:51 +02:00
|
|
|
<Grid.ColumnDefinitions>
|
2017-10-26 18:57:39 +02:00
|
|
|
<ColumnDefinition x:Name="PrimaryColumn" Width="350" />
|
|
|
|
<ColumnDefinition x:Name="SecondaryColumn" Width="*" />
|
2017-09-15 15:58:51 +02:00
|
|
|
</Grid.ColumnDefinitions>
|
2017-10-26 18:57:39 +02:00
|
|
|
|
|
|
|
<!-- Back button and page title -->
|
|
|
|
<Grid x:Name="TitlePanel" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button x:Name="BackButton" Margin="39,20,0,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
|
|
|
|
Style="{StaticResource NavigationBackButtonNormalStyle}"
|
|
|
|
Visibility="Collapsed"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
AutomationProperties.Name="Back"
|
|
|
|
AutomationProperties.AutomationId="BackButton"
|
|
|
|
AutomationProperties.ItemType="Navigation Button"/>
|
|
|
|
<TextBlock x:Name="TitleTextBox" Text="{Binding Name}" Grid.Column="1" FontSize="24" Margin="20" />
|
|
|
|
</Grid>
|
|
|
|
<controls:ListViewWithDisable
|
|
|
|
Grid.Column="0"
|
|
|
|
Grid.Row="1"
|
2017-10-06 16:33:44 +02:00
|
|
|
x:Name="MenuListView"
|
2017-10-26 18:57:39 +02:00
|
|
|
SelectionChanged="MenuListView_SelectionChanged"
|
|
|
|
Background="{ThemeResource AppBarBackgroundThemeBrush}"
|
2017-10-06 16:33:44 +02:00
|
|
|
ItemsSource="{Binding Source={StaticResource MenuItemsSource}}"
|
2017-10-09 18:40:02 +02:00
|
|
|
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
2017-10-06 16:33:44 +02:00
|
|
|
IsSynchronizedWithCurrentItem="False">
|
2017-10-26 18:57:39 +02:00
|
|
|
<controls:ListViewWithDisable.ItemTemplate>
|
2017-09-27 18:01:21 +02:00
|
|
|
<DataTemplate >
|
2017-09-29 18:08:20 +02:00
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<SymbolIcon Symbol="{Binding SymbolIcon}" />
|
|
|
|
<TextBlock Text="{Binding Title}" Margin="10,5,0,0" />
|
|
|
|
</StackPanel>
|
2017-09-20 18:19:00 +02:00
|
|
|
</DataTemplate>
|
2017-10-26 18:57:39 +02:00
|
|
|
</controls:ListViewWithDisable.ItemTemplate>
|
|
|
|
<controls:ListViewWithDisable.ItemContainerStyle>
|
2017-09-20 18:19:00 +02:00
|
|
|
<Style TargetType="ListViewItem">
|
2017-09-27 18:01:21 +02:00
|
|
|
<Setter Property="Padding" Value="20,5,0,0" />
|
2017-10-06 17:57:36 +02:00
|
|
|
<Setter Property="Margin" Value="0" />
|
2017-09-20 18:19:00 +02:00
|
|
|
</Style>
|
2017-10-26 18:57:39 +02:00
|
|
|
</controls:ListViewWithDisable.ItemContainerStyle>
|
|
|
|
<controls:ListViewWithDisable.GroupStyle>
|
2017-09-28 17:51:30 +02:00
|
|
|
<GroupStyle HidesIfEmpty="True">
|
|
|
|
<GroupStyle.HeaderTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Grid Background="DarkGray" Margin="20,0,0,0">
|
2017-10-26 18:57:39 +02:00
|
|
|
<Border Height="1" Width="300" HorizontalAlignment="Stretch"/>
|
2017-09-28 17:51:30 +02:00
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</GroupStyle.HeaderTemplate>
|
|
|
|
</GroupStyle>
|
2017-10-26 18:57:39 +02:00
|
|
|
</controls:ListViewWithDisable.GroupStyle>
|
2017-09-27 18:01:21 +02:00
|
|
|
</controls:ListViewWithDisable>
|
2017-10-26 18:57:39 +02:00
|
|
|
<Frame x:Name="MenuFrame" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Width="auto" Margin="30,60,0,0" />
|
|
|
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
<!-- Visual states reflect the application's view state -->
|
|
|
|
<VisualStateGroup x:Name="ViewStates">
|
|
|
|
<VisualState x:Name="PrimaryView" />
|
|
|
|
<VisualState x:Name="SinglePane">
|
|
|
|
<Storyboard>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PrimaryColumn" Storyboard.TargetProperty="Width">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="*"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SecondaryColumn" Storyboard.TargetProperty="Width">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuFrame" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuListView" Storyboard.TargetProperty="Padding">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="120,0,90,60"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<!--
|
|
|
|
When an item is selected and only one pane is shown the details display requires more extensive changes:
|
|
|
|
* Hide the master list and the column it was in
|
|
|
|
* Move item details down a row to make room for the title
|
|
|
|
* Move the title directly above the details
|
|
|
|
* Adjust padding for details
|
|
|
|
-->
|
|
|
|
<VisualState x:Name="SinglePane_Detail">
|
|
|
|
<Storyboard>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PrimaryColumn" Storyboard.TargetProperty="Width">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuListView" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuFrame" Storyboard.TargetProperty="(Grid.Row)">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuFrame" Storyboard.TargetProperty="(Grid.RowSpan)">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TitlePanel" Storyboard.TargetProperty="(Grid.Column)">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="1"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackButton" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TitleTextBox" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MenuFrame" Storyboard.TargetProperty="Margin">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="10,0,0,0"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
</VisualStateGroup>
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
2017-09-10 13:49:11 -04:00
|
|
|
</Grid>
|
2017-10-26 18:57:39 +02:00
|
|
|
</basePages:LayoutAwarePageBase>
|