2018-07-02 18:23:43 +02:00
|
|
|
<UserControl x:Name="UserControl"
|
|
|
|
x:Class="ModernKeePass.Views.UserControls.TopMenuUserControl"
|
|
|
|
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"
|
|
|
|
mc:Ignorable="d">
|
2018-07-26 16:28:28 +02:00
|
|
|
<UserControl.Resources>
|
|
|
|
<Style BasedOn="{StaticResource NoBorderButtonStyle}" TargetType="Button" x:Key="MenuButtonStyle" >
|
|
|
|
<Setter Property="Padding" Value="25,0,25,0" />
|
|
|
|
<Setter Property="Background" Value="{ThemeResource ToggleButtonBackgroundThemeBrush}" />
|
|
|
|
<Setter Property="Height" Value="{StaticResource MenuSize}" />
|
|
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource NoBorderToggleButtonStyle}" TargetType="ToggleButton" x:Key="MenuToggleButtonStyle" >
|
|
|
|
<Setter Property="Padding" Value="25,0,25,0" />
|
|
|
|
<Setter Property="Height" Value="{StaticResource MenuSize}" />
|
|
|
|
</Style>
|
|
|
|
</UserControl.Resources>
|
2018-07-02 18:23:43 +02:00
|
|
|
<StackPanel Orientation="Horizontal">
|
2018-09-09 20:01:56 +02:00
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
<VisualStateGroup x:Name="VisibilityStates">
|
|
|
|
<VisualState x:Name="Overflowed">
|
|
|
|
<Storyboard>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverflowButtons" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MoreButton" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
<VisualState x:Name="Collapsed">
|
|
|
|
<Storyboard>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OverflowButtons" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MoreButton" Storyboard.TargetProperty="Visibility">
|
|
|
|
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
|
|
|
|
</ObjectAnimationUsingKeyFrames>
|
|
|
|
</Storyboard>
|
|
|
|
</VisualState>
|
|
|
|
</VisualStateGroup>
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
<StackPanel x:Name="OverflowButtons" Orientation="Horizontal">
|
2018-08-02 17:40:30 +02:00
|
|
|
<Button Command="{Binding RestoreCommand, ElementName=UserControl}" Visibility="{Binding RestoreButtonVisibility, ElementName=UserControl}" Click="RestoreButton_Click" Style="{StaticResource MenuButtonStyle}">
|
2018-07-05 18:32:42 +02:00
|
|
|
<SymbolIcon Symbol="Undo">
|
|
|
|
<ToolTipService.ToolTip>
|
2018-07-25 18:08:59 +02:00
|
|
|
<ToolTip x:Uid="TopMenuRestoreButton" />
|
2018-07-05 18:32:42 +02:00
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
</SymbolIcon>
|
|
|
|
</Button>
|
2018-07-26 16:28:28 +02:00
|
|
|
<Button Command="{Binding SaveCommand, ElementName=UserControl}" Style="{StaticResource MenuButtonStyle}">
|
2018-07-05 18:32:42 +02:00
|
|
|
<SymbolIcon Symbol="Save">
|
|
|
|
<ToolTipService.ToolTip>
|
2018-07-25 18:08:59 +02:00
|
|
|
<ToolTip x:Uid="TopMenuSaveButton" />
|
2018-07-05 18:32:42 +02:00
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
</SymbolIcon>
|
|
|
|
</Button>
|
2018-07-26 16:28:28 +02:00
|
|
|
<Button Visibility="{Binding SortButtonVisibility, ElementName=UserControl}" Style="{StaticResource MenuButtonStyle}">
|
2018-07-11 12:15:56 +02:00
|
|
|
<SymbolIcon Symbol="Sort">
|
|
|
|
<ToolTipService.ToolTip>
|
2018-07-25 18:08:59 +02:00
|
|
|
<ToolTip x:Uid="TopMenuSortButton" />
|
2018-07-11 12:15:56 +02:00
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
</SymbolIcon>
|
|
|
|
<Button.Flyout>
|
2018-07-11 13:48:15 +02:00
|
|
|
<MenuFlyout Opening="SortFlyout_OnOpening">
|
|
|
|
<MenuFlyoutItem x:Uid="AppBarSortEntries" x:Name="SortEntriesButtonFlyout" Command="{Binding SortEntriesCommand, ElementName=UserControl}" />
|
|
|
|
<MenuFlyoutItem x:Uid="AppBarSortGroups" x:Name="SortGroupsButtonFlyout" Command="{Binding SortGroupsCommand, ElementName=UserControl}" />
|
2018-07-11 12:15:56 +02:00
|
|
|
</MenuFlyout>
|
|
|
|
</Button.Flyout>
|
|
|
|
</Button>
|
2018-07-26 16:28:28 +02:00
|
|
|
<ToggleButton Command="{Binding EditCommand, ElementName=UserControl}" IsChecked="{Binding IsEditButtonChecked, ElementName=UserControl, Mode=TwoWay}" Checked="EditButton_Click" Style="{StaticResource MenuToggleButtonStyle}">
|
2018-07-11 13:48:15 +02:00
|
|
|
<SymbolIcon Symbol="Edit">
|
|
|
|
<ToolTipService.ToolTip>
|
2018-07-25 18:08:59 +02:00
|
|
|
<ToolTip x:Uid="TopMenuEditButton" />
|
2018-07-11 13:48:15 +02:00
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
</SymbolIcon>
|
|
|
|
</ToggleButton>
|
2018-07-26 16:28:28 +02:00
|
|
|
<Button Command="{Binding DeleteCommand, ElementName=UserControl}" IsEnabled="{Binding IsDeleteButtonEnabled, ElementName=UserControl}" Visibility="{Binding DeleteButtonVisibility, ElementName=UserControl}" Click="DeleteButton_Click" Style="{StaticResource MenuButtonStyle}">
|
2018-07-05 18:32:42 +02:00
|
|
|
<SymbolIcon Symbol="Delete">
|
|
|
|
<ToolTipService.ToolTip>
|
2018-07-25 18:08:59 +02:00
|
|
|
<ToolTip x:Uid="TopMenuDeleteButton" />
|
2018-07-05 18:32:42 +02:00
|
|
|
</ToolTipService.ToolTip>
|
|
|
|
</SymbolIcon>
|
|
|
|
</Button>
|
|
|
|
</StackPanel>
|
2018-09-09 20:01:56 +02:00
|
|
|
<Button x:Name="MoreButton" Style="{StaticResource MenuButtonStyle}">
|
2018-07-02 18:23:43 +02:00
|
|
|
<SymbolIcon Symbol="More" />
|
|
|
|
<Button.Flyout>
|
2018-07-11 13:48:15 +02:00
|
|
|
<MenuFlyout Opening="OverflowFlyout_OnOpening">
|
2018-08-02 17:40:30 +02:00
|
|
|
<MenuFlyoutItem x:Uid="TopMenuRestoreFlyout" x:Name="RestoreFlyout" Command="{Binding RestoreCommand, ElementName=UserControl}" Click="RestoreButton_Click" Visibility="{Binding RestoreButtonVisibility, ElementName=UserControl}" />
|
2018-07-04 18:26:16 +02:00
|
|
|
<MenuFlyoutItem x:Uid="TopMenuSaveFlyout" Command="{Binding SaveCommand, ElementName=UserControl}" />
|
2018-07-10 18:26:27 +02:00
|
|
|
<ToggleMenuFlyoutItem x:Uid="TopMenuEditFlyout" x:Name="EditFlyout" Command="{Binding EditCommand, ElementName=UserControl}" IsChecked="{Binding IsEditButtonChecked, ElementName=UserControl, Mode=TwoWay}" Click="EditButton_Click" />
|
|
|
|
<MenuFlyoutItem x:Uid="TopMenuDeleteFlyout" x:Name="DeleteFlyout" Command="{Binding DeleteCommand, ElementName=UserControl}" Click="DeleteButton_Click" Visibility="{Binding DeleteButtonVisibility, ElementName=UserControl}" IsEnabled="{Binding IsDeleteButtonEnabled, ElementName=UserControl}" />
|
2018-07-11 13:48:15 +02:00
|
|
|
<MenuFlyoutItem x:Uid="TopMenuSortEntriesFlyout" x:Name="SortEntriesFlyout" Command="{Binding SortEntriesCommand, ElementName=UserControl}" Visibility="{Binding SortButtonVisibility, ElementName=UserControl}" />
|
|
|
|
<MenuFlyoutItem x:Uid="TopMenuSortGroupsFlyout" x:Name="SortGroupsFlyout" Command="{Binding SortGroupsCommand, ElementName=UserControl}" Visibility="{Binding SortButtonVisibility, ElementName=UserControl}" />
|
2018-07-02 18:23:43 +02:00
|
|
|
</MenuFlyout>
|
|
|
|
</Button.Flyout>
|
|
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
|
|
</UserControl>
|