mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00

New tooltip in Textbox with button control New welcome page in Settings (shown when noting is selected) Settings are now grouped
303 lines
18 KiB
XML
303 lines
18 KiB
XML
<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"
|
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
|
xmlns:converters="using:ModernKeePass.Converters"
|
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
|
xmlns:actions="using:ModernKeePass.Actions"
|
|
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
|
x:Name="PageRoot"
|
|
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
|
mc:Ignorable="d" >
|
|
<Page.Resources>
|
|
<SolidColorBrush x:Key="Transparent" Color="Transparent"/>
|
|
<SolidColorBrush x:Key="SystemColor" Color="{StaticResource SystemColorButtonFaceColor}" />
|
|
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
|
<converters:BooleanToFontStyleConverter x:Key="BooleanToFontStyleConverter"/>
|
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
<converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/>
|
|
</Page.Resources>
|
|
<Page.DataContext>
|
|
<viewModels:GroupVm />
|
|
</Page.DataContext>
|
|
<Page.BottomAppBar>
|
|
<CommandBar x:Name="CommandBar" VerticalAlignment="Center">
|
|
<CommandBar.SecondaryCommands>
|
|
<AppBarButton Icon="Save" Label="Save">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="Click">
|
|
<core:CallMethodAction TargetObject="{Binding}" MethodName="Save"/>
|
|
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</AppBarButton>
|
|
<AppBarButton Icon="Setting" Label="Settings">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="Click">
|
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.SettingsPage" />
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</AppBarButton>
|
|
</CommandBar.SecondaryCommands>
|
|
<AppBarToggleButton Icon="Edit" Label="Edit" IsChecked="{Binding IsEditMode, Mode=TwoWay}">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="Click">
|
|
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</AppBarToggleButton>
|
|
<AppBarButton Icon="Undo" Label="Restore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Click="RestoreButton_Click">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="Click">
|
|
<core:CallMethodAction MethodName="UndoDelete" TargetObject="{Binding}" />
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</AppBarButton>
|
|
<AppBarButton Icon="Delete" Label="Delete" IsEnabled="{Binding IsNotRoot}" Click="DeleteButton_Click" />
|
|
</CommandBar>
|
|
</Page.BottomAppBar>
|
|
<Grid>
|
|
<Grid.Resources>
|
|
<CollectionViewSource
|
|
x:Name="GroupsViewSource"
|
|
Source="{Binding Groups}" />
|
|
<CollectionViewSource
|
|
x:Name="EntriesViewSource"
|
|
Source="{Binding Entries}" />
|
|
<CollectionViewSource
|
|
x:Name="EntriesZoomedOutViewSource"
|
|
Source="{Binding EntriesZoomedOut}" IsSourceGrouped="True"/>
|
|
</Grid.Resources>
|
|
<Grid.Background>
|
|
<StaticResource ResourceKey="ApplicationPageBackgroundThemeBrush"/>
|
|
</Grid.Background>
|
|
<Grid.ChildrenTransitions>
|
|
<TransitionCollection>
|
|
<EntranceThemeTransition/>
|
|
</TransitionCollection>
|
|
</Grid.ChildrenTransitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="50"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<ListView
|
|
Grid.Column="0"
|
|
x:Name="LeftListView"
|
|
Margin="0,0,0,-10"
|
|
SelectionChanged="groups_SelectionChanged"
|
|
IsSwipeEnabled="false"
|
|
IsSynchronizedWithCurrentItem="False"
|
|
DataContext="{Binding DataContext, ElementName=PageRoot}"
|
|
RequestedTheme="Dark"
|
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
|
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}">
|
|
<ListView.Resources>
|
|
<DataTemplate x:Name="Collapsed">
|
|
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0">
|
|
<ToolTipService.ToolTip>
|
|
<ToolTip Content="{Binding Name}" />
|
|
</ToolTipService.ToolTip>
|
|
</SymbolIcon>
|
|
</DataTemplate>
|
|
<DataTemplate x:Name="Expanded">
|
|
<StackPanel Orientation="Horizontal">
|
|
<SymbolIcon Symbol="{Binding IconSymbol}" Margin="8,0,0,0" />
|
|
<TextBlock Text="{Binding Name}" FontWeight="{Binding FontWeight}" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="30,0,20,0" FontStyle="{Binding IsSelected, Converter={StaticResource BooleanToFontStyleConverter}}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListView.Resources>
|
|
<ListView.ItemsSource>
|
|
<Binding Source="{StaticResource GroupsViewSource}"/>
|
|
</ListView.ItemsSource>
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
<!--<Setter Property="HorizontalContentAlignment" Value="Center" />-->
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Margin" Value="0"/>
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
<ListView.HeaderTemplate>
|
|
<DataTemplate>
|
|
<ToggleButton Style="{StaticResource HamburgerToggleButton}">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:EventTriggerBehavior EventName="Loaded">
|
|
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Collapsed}" TargetObject="{Binding ElementName=LeftListView}"/>
|
|
</core:EventTriggerBehavior>
|
|
<core:EventTriggerBehavior EventName="Checked">
|
|
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Expanded}" TargetObject="{Binding ElementName=LeftListView}"/>
|
|
</core:EventTriggerBehavior>
|
|
<core:EventTriggerBehavior EventName="Unchecked">
|
|
<core:ChangePropertyAction PropertyName="ItemTemplate" Value="{StaticResource Collapsed}" TargetObject="{Binding ElementName=LeftListView}"/>
|
|
</core:EventTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</ToggleButton>
|
|
</DataTemplate>
|
|
</ListView.HeaderTemplate>
|
|
</ListView>
|
|
<!-- Horizontal scrolling grid -->
|
|
<SemanticZoom Grid.Column="1" ViewChangeStarted="SemanticZoom_ViewChangeStarted" Margin="0,30,0,0">
|
|
<SemanticZoom.ZoomedInView>
|
|
<GridView
|
|
x:Name="GridView"
|
|
AutomationProperties.AutomationId="ItemGridView"
|
|
AutomationProperties.Name="Entries"
|
|
TabIndex="1"
|
|
SelectionChanged="entries_SelectionChanged"
|
|
IsSynchronizedWithCurrentItem="False">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:DataTriggerBehavior Binding="{Binding IsEditMode}" Value="False">
|
|
<actions:SetupFocusAction TargetObject="{Binding ElementName=GridView}" />
|
|
</core:DataTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
<GridView.Resources>
|
|
<DataTemplate x:Name="GroupFirstItem">
|
|
<Border
|
|
BorderThickness="2"
|
|
BorderBrush="{StaticResource SystemColor}"
|
|
Background="{StaticResource HubSectionHeaderPressedForegroundThemeBrush}">
|
|
<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" RenderTransformOrigin="0.5,0.5" Foreground="{ThemeResource TextBoxBackgroundThemeBrush}" >
|
|
<SymbolIcon.RenderTransform>
|
|
<CompositeTransform ScaleX="2" TranslateX="0" TranslateY="0" ScaleY="2"/>
|
|
</SymbolIcon.RenderTransform>
|
|
</SymbolIcon>
|
|
<TextBlock Grid.Column="1" Text="{Binding Name}" FontWeight="Bold" Style="{ThemeResource TitleTextBlockStyle}" Foreground="{ThemeResource TextBoxBackgroundThemeBrush}" TextWrapping="NoWrap" VerticalAlignment="Center" Margin="13,0,0,5"/>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
<DataTemplate x:Name="GroupOtherItem">
|
|
<Grid Height="110" Width="480" x:Name="EntryGrid" >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border
|
|
Grid.Column="0"
|
|
BorderThickness="2"
|
|
BorderBrush="{StaticResource SystemColor}"
|
|
Background="{Binding BackgroundColor, ConverterParameter={StaticResource Transparent}, Converter={StaticResource ColorToBrushConverter}}">
|
|
<SymbolIcon Symbol="{Binding IconSymbol}" Width="100" Height="100" RenderTransformOrigin="0.5,0.5" >
|
|
<SymbolIcon.RenderTransform>
|
|
<CompositeTransform ScaleX="2" TranslateX="0" TranslateY="0" ScaleY="2"/>
|
|
</SymbolIcon.RenderTransform>
|
|
</SymbolIcon>
|
|
</Border>
|
|
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,10,0,0" >
|
|
<TextBlock x:Name="NameTextBlock" Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Foreground="{Binding ForegroundColor, ConverterParameter={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource ColorToBrushConverter}}"/>
|
|
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
|
|
<TextBlock Text="{Binding UserName}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
|
|
<TextBlock Text="{Binding Url}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</GridView.Resources>
|
|
<GridView.ItemsSource>
|
|
<Binding Source="{StaticResource EntriesViewSource}"/>
|
|
</GridView.ItemsSource>
|
|
<GridView.DataContext>
|
|
<viewModels:EntryVm/>
|
|
</GridView.DataContext>
|
|
<GridView.ItemTemplateSelector>
|
|
<templateSelectors:FirstItemDataTemplateSelector
|
|
FirstItem="{StaticResource GroupFirstItem}"
|
|
OtherItem="{StaticResource GroupOtherItem}" />
|
|
</GridView.ItemTemplateSelector>
|
|
<GridView.ItemContainerStyle>
|
|
<Style TargetType="FrameworkElement">
|
|
<Setter Property="Margin" Value="52,0,0,2"/>
|
|
</Style>
|
|
</GridView.ItemContainerStyle>
|
|
</GridView>
|
|
</SemanticZoom.ZoomedInView>
|
|
|
|
<SemanticZoom.ZoomedOutView>
|
|
<ListView
|
|
x:Name="SemanticListView"
|
|
ItemsSource="{Binding Source={StaticResource EntriesZoomedOutViewSource}}"
|
|
IsSwipeEnabled="false"
|
|
SelectionChanged="groups_SelectionChanged"
|
|
IsSynchronizedWithCurrentItem="False">
|
|
<ListView.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListView.ItemsPanel>
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
<ListView.GroupStyle>
|
|
<GroupStyle HidesIfEmpty="True">
|
|
<GroupStyle.HeaderTemplate>
|
|
<DataTemplate>
|
|
<Grid Background="LightGray" Margin="0,0,10,0" HorizontalAlignment="Left">
|
|
<TextBlock Text="{Binding Key}" Width="40" Foreground="Black" Margin="30" Style="{StaticResource HeaderTextBlockStyle}"/>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</GroupStyle.HeaderTemplate>
|
|
</GroupStyle>
|
|
</ListView.GroupStyle>
|
|
</ListView>
|
|
</SemanticZoom.ZoomedOutView>
|
|
</SemanticZoom>
|
|
|
|
</Grid>
|
|
<!-- Back button and page title -->
|
|
<Grid Grid.Row="0" Background="{ThemeResource AppBarBackgroundThemeBrush}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="60"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="400"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Button Grid.Column="0"
|
|
x:Name="BackButton"
|
|
Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
|
|
Height="50"
|
|
Width="50"
|
|
AutomationProperties.Name="Back"
|
|
AutomationProperties.AutomationId="BackButton"
|
|
AutomationProperties.ItemType="Navigation Button"
|
|
Style="{StaticResource NoBorderButtonStyle}">
|
|
<SymbolIcon Symbol="Back" />
|
|
</Button>
|
|
<StackPanel Grid.Column="1" >
|
|
<TextBox
|
|
x:Name="TitleTextBox"
|
|
Text="{Binding Name, Mode=TwoWay}"
|
|
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"
|
|
Background="Transparent"
|
|
IsHitTestVisible="{Binding IsEditMode}"
|
|
BorderThickness="0"
|
|
FontSize="20"
|
|
FontWeight="SemiBold"
|
|
TextWrapping="NoWrap"
|
|
VerticalAlignment="Center"
|
|
PlaceholderText="New group name...">
|
|
<interactivity:Interaction.Behaviors>
|
|
<core:DataTriggerBehavior Binding="{Binding IsEditMode}" Value="True">
|
|
<actions:SetupFocusAction TargetObject="{Binding ElementName=TitleTextBox}" />
|
|
</core:DataTriggerBehavior>
|
|
</interactivity:Interaction.Behaviors>
|
|
</TextBox>
|
|
<TextBlock FontSize="12" Text="{Binding Path}" />
|
|
</StackPanel>
|
|
<SearchBox Grid.Column="2" PlaceholderText="Search..." Width="350" Background="{ThemeResource TextBoxDisabledBackgroundThemeBrush}" BorderThickness="0" FontSize="18" SuggestionsRequested="SearchBox_OnSuggestionsRequested" SearchHistoryEnabled="False" ResultSuggestionChosen="SearchBox_OnResultSuggestionChosen" />
|
|
</Grid>
|
|
</Grid>
|
|
</Page> |