2017-09-12 18:20:32 +02:00
|
|
|
<Page
|
|
|
|
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-10-02 18:40:54 +02:00
|
|
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
|
|
|
xmlns:converters="using:ModernKeePass.Converters"
|
2017-10-03 16:06:49 +02:00
|
|
|
xmlns:local="using:ModernKeePass.Controls"
|
2017-10-02 18:40:54 +02:00
|
|
|
x:Name="PageRoot"
|
2017-09-13 18:37:44 +02:00
|
|
|
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
2017-09-15 11:24:14 +02:00
|
|
|
mc:Ignorable="d" >
|
2017-09-29 18:08:20 +02:00
|
|
|
<Page.Resources>
|
2017-10-03 16:06:49 +02:00
|
|
|
<SolidColorBrush x:Key="Transparent" Color="Transparent"/>
|
|
|
|
<SolidColorBrush x:Key="White" Color="White"/>
|
|
|
|
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
2017-10-02 18:40:54 +02:00
|
|
|
<converters:PluralizationConverter x:Key="PluralizationConverter"/>
|
2017-10-03 16:06:49 +02:00
|
|
|
<DataTemplate x:Name="GroupFirstItem">
|
|
|
|
<Border
|
|
|
|
BorderThickness="2"
|
|
|
|
BorderBrush="DimGray"
|
|
|
|
Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
|
|
|
|
Margin="0,10,0,0" >
|
|
|
|
<Grid Height="110" Width="480" >
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<SymbolIcon Grid.Column="0" Symbol="{Binding IconSymbol}" Width="100" Height="100" />
|
|
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="13,0,0,5"/>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Name="GroupOtherItem">
|
|
|
|
<Border
|
|
|
|
BorderThickness="2"
|
|
|
|
BorderBrush="DimGray"
|
|
|
|
Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"
|
|
|
|
Margin="0,10,0,0" >
|
|
|
|
<Grid Height="110" Width="480" >
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<SymbolIcon Grid.Column="0" Symbol="{Binding IconSymbol}" Width="100" Height="100" />
|
|
|
|
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0" >
|
|
|
|
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
|
|
|
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
|
|
|
|
<TextBlock Text="{Binding EntryCount, ConverterParameter=entry\,entries, Converter={StaticResource PluralizationConverter}}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
|
|
|
|
<TextBlock Text="{Binding GroupCount, ConverterParameter=group\,groups, Converter={StaticResource PluralizationConverter}}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
2017-09-29 18:08:20 +02:00
|
|
|
</Page.Resources>
|
2017-09-15 11:24:14 +02:00
|
|
|
<Page.DataContext>
|
2017-10-02 18:40:54 +02:00
|
|
|
<viewModels:GroupVm />
|
2017-09-15 11:24:14 +02:00
|
|
|
</Page.DataContext>
|
2017-09-12 18:20:32 +02:00
|
|
|
<Grid>
|
2017-09-29 18:08:20 +02:00
|
|
|
<Grid.Resources>
|
|
|
|
<CollectionViewSource
|
2017-10-02 18:40:54 +02:00
|
|
|
x:Name="GroupsViewSource"
|
2017-09-29 18:08:20 +02:00
|
|
|
Source="{Binding Groups}"/>
|
|
|
|
<CollectionViewSource
|
2017-10-02 18:40:54 +02:00
|
|
|
x:Name="EntriesViewSource"
|
2017-09-29 18:08:20 +02:00
|
|
|
Source="{Binding Entries}"/>
|
|
|
|
</Grid.Resources>
|
2017-09-12 18:20:32 +02:00
|
|
|
<Grid.ChildrenTransitions>
|
|
|
|
<TransitionCollection>
|
|
|
|
<EntranceThemeTransition/>
|
|
|
|
</TransitionCollection>
|
|
|
|
</Grid.ChildrenTransitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="140"/>
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Horizontal scrolling grid -->
|
2017-10-02 18:40:54 +02:00
|
|
|
<SemanticZoom
|
2017-09-27 18:01:21 +02:00
|
|
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
2017-09-12 18:20:32 +02:00
|
|
|
Grid.RowSpan="2"
|
2017-10-02 18:40:54 +02:00
|
|
|
Padding="20,126,20,50">
|
|
|
|
<SemanticZoom.ZoomedInView>
|
|
|
|
<GridView
|
|
|
|
AutomationProperties.AutomationId="ItemGridView"
|
|
|
|
AutomationProperties.Name="Groups"
|
|
|
|
TabIndex="1"
|
|
|
|
ItemsSource="{Binding Source={StaticResource GroupsViewSource}}"
|
|
|
|
IsSwipeEnabled="false"
|
|
|
|
SelectionChanged="groups_SelectionChanged"
|
2017-09-29 18:08:20 +02:00
|
|
|
IsSynchronizedWithCurrentItem="False" >
|
2017-10-03 16:06:49 +02:00
|
|
|
<GridView.ItemTemplateSelector>
|
|
|
|
<local:FirstItemDataTemplateSelector
|
|
|
|
FirstItem="{StaticResource GroupFirstItem}"
|
|
|
|
OtherItem="{StaticResource GroupOtherItem}" />
|
|
|
|
</GridView.ItemTemplateSelector>
|
2017-10-02 18:40:54 +02:00
|
|
|
<GridView.Header>
|
|
|
|
<ListView
|
|
|
|
Height="auto"
|
|
|
|
Width="480"
|
|
|
|
ItemsSource="{Binding Source={StaticResource EntriesViewSource}}"
|
|
|
|
Margin="10,0,0,0"
|
|
|
|
SelectionChanged="entriesListView_SelectionChanged"
|
|
|
|
IsSwipeEnabled="false"
|
|
|
|
IsSynchronizedWithCurrentItem="False" >
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
<DataTemplate>
|
2017-10-03 16:06:49 +02:00
|
|
|
<StackPanel
|
|
|
|
Orientation="Horizontal"
|
|
|
|
Background="{Binding BackgroundColor, ConverterParameter={StaticResource Transparent}, Converter={StaticResource ColorToBrushConverter}}">
|
2017-10-02 18:40:54 +02:00
|
|
|
<SymbolIcon Symbol="{Binding IconSymbol}" />
|
2017-10-03 16:06:49 +02:00
|
|
|
<TextBlock
|
|
|
|
Text="{Binding Title}"
|
|
|
|
FontWeight="{Binding FontWeight}"
|
|
|
|
TextWrapping="NoWrap"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="30,0,0,0"
|
|
|
|
Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource White}, Converter={StaticResource ColorToBrushConverter}}"/>
|
2017-10-02 18:40:54 +02:00
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
<ListView.HeaderTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<TextBlock Text="{Binding EntryCount, ConverterParameter=entry\,entries, Converter={StaticResource PluralizationConverter}}" FontSize="20" Margin="0,20,0,20" />
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.HeaderTemplate>
|
|
|
|
<ListView.ItemContainerStyle>
|
|
|
|
<Style TargetType="ListViewItem">
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
|
|
</Style>
|
|
|
|
</ListView.ItemContainerStyle>
|
|
|
|
</ListView>
|
|
|
|
</GridView.Header>
|
|
|
|
<GridView.ItemContainerStyle>
|
|
|
|
<Style TargetType="FrameworkElement">
|
|
|
|
<Setter Property="Margin" Value="52,0,0,2"/>
|
|
|
|
</Style>
|
|
|
|
</GridView.ItemContainerStyle>
|
|
|
|
</GridView>
|
|
|
|
</SemanticZoom.ZoomedInView>
|
|
|
|
|
|
|
|
<SemanticZoom.ZoomedOutView>
|
|
|
|
<ListView
|
|
|
|
ItemsSource="{Binding Source={StaticResource GroupsViewSource}}"
|
|
|
|
IsSwipeEnabled="false"
|
|
|
|
SelectionChanged="groups_SelectionChanged"
|
|
|
|
IsSynchronizedWithCurrentItem="False" >
|
|
|
|
<ListView.ItemTemplate>
|
2017-09-29 18:08:20 +02:00
|
|
|
<DataTemplate>
|
2017-10-03 16:06:49 +02:00
|
|
|
<TextBlock
|
|
|
|
Text="{Binding Name}"
|
|
|
|
Style="{StaticResource TitleTextBlockStyle}"
|
|
|
|
TextWrapping="NoWrap"/>
|
2017-09-29 18:08:20 +02:00
|
|
|
</DataTemplate>
|
2017-10-02 18:40:54 +02:00
|
|
|
</ListView.ItemTemplate>
|
2017-09-29 18:08:20 +02:00
|
|
|
</ListView>
|
2017-10-02 18:40:54 +02:00
|
|
|
</SemanticZoom.ZoomedOutView>
|
|
|
|
</SemanticZoom>
|
|
|
|
|
2017-09-12 18:20:32 +02:00
|
|
|
<!-- Back button and page title -->
|
2017-10-02 18:40:54 +02:00
|
|
|
<Grid Grid.Row="0">
|
2017-09-12 18:20:32 +02:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="120"/>
|
|
|
|
<ColumnDefinition Width="*"/>
|
2017-10-02 18:40:54 +02:00
|
|
|
<ColumnDefinition Width="200"/>
|
2017-09-12 18:20:32 +02:00
|
|
|
</Grid.ColumnDefinitions>
|
2017-10-03 16:06:49 +02:00
|
|
|
<Button Margin="39,59,39,0"
|
|
|
|
Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
|
|
|
|
Style="{StaticResource NavigationBackButtonNormalStyle}"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
AutomationProperties.Name="Back"
|
|
|
|
AutomationProperties.AutomationId="BackButton"
|
|
|
|
AutomationProperties.ItemType="Navigation Button"/>
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="1"
|
|
|
|
Text="{Binding Name}"
|
|
|
|
Style="{StaticResource HeaderTextBlockStyle}"
|
|
|
|
IsHitTestVisible="false"
|
|
|
|
TextWrapping="NoWrap"
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
Margin="0,0,30,40"/>
|
|
|
|
<CommandBar
|
|
|
|
Grid.Column="2"
|
|
|
|
Margin="0,40,0,0"
|
|
|
|
Background="Transparent"
|
|
|
|
IsOpen="True">
|
|
|
|
<AppBarButton Icon="Save" Label="Save" />
|
|
|
|
<CommandBar.SecondaryCommands>
|
|
|
|
<AppBarButton Icon="Edit" Label="Edit" />
|
|
|
|
<AppBarButton Icon="Delete" Label="Delete" IsEnabled="{Binding IsNotRoot}" Click="AppBarButton_Click" />
|
|
|
|
</CommandBar.SecondaryCommands>
|
2017-10-02 18:40:54 +02:00
|
|
|
</CommandBar>
|
2017-09-12 18:20:32 +02:00
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Page>
|