mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
History list fully functional in Entry page
Viewing a historic entry disables controls on the page Enhancements in the hamburger menu
This commit is contained in:
@@ -10,21 +10,22 @@
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
|
||||
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/>
|
||||
</UserControl.Resources>
|
||||
<ListView
|
||||
ItemsSource="{Binding ItemsSource, ElementName=UserControl}"
|
||||
SelectionChanged="Selector_OnSelectionChanged"
|
||||
SelectedItem="{Binding SelectedItem, ElementName=UserControl}"
|
||||
IsSwipeEnabled="false"
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
RequestedTheme="Dark"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}">
|
||||
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<ListView.Resources>
|
||||
<DataTemplate x:Name="IsSpecial">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}}" Margin="8,0,0,0">
|
||||
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}}" Margin="3,0,0,0">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||
</ToolTipService.ToolTip>
|
||||
@@ -34,7 +35,7 @@
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Name="IsNormal">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}}" Margin="8,0,0,0">
|
||||
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}}" Margin="3,0,0,0">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||
</ToolTipService.ToolTip>
|
||||
@@ -46,14 +47,6 @@
|
||||
<ListView.ItemTemplateSelector>
|
||||
<templateSelectors:SelectableDataTemplateSelector FalseItem="{StaticResource IsNormal}" TrueItem="{StaticResource IsSpecial}" />
|
||||
</ListView.ItemTemplateSelector>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="AllowDrop" Value="True"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -76,7 +69,7 @@
|
||||
</ListView.HeaderTemplate>
|
||||
<ListView.FooterTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Visibility="{Binding IsButtonVisible, ElementName=UserControl, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
|
||||
<StackPanel Orientation="Vertical" Visibility="{Binding IsButtonVisible, ElementName=UserControl}">
|
||||
<Border BorderBrush="White" BorderThickness="0,0,0,1" />
|
||||
<Button Padding="0" Height="50" Margin="0" Style="{StaticResource NoBorderButtonStyle}" Background="Transparent" BorderThickness="0" Click="ButtonBase_OnClick">
|
||||
<StackPanel Orientation="Horizontal" Margin="13,0,5,0">
|
||||
|
@@ -48,7 +48,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
"DisplayMemberPath",
|
||||
typeof(string),
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata("Name", (o, args) => { }));
|
||||
new PropertyMetadata("Title", (o, args) => { }));
|
||||
|
||||
public object ResizeTarget
|
||||
{
|
||||
@@ -62,17 +62,17 @@ namespace ModernKeePass.Views.UserControls
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata(null, (o, args) => { }));
|
||||
|
||||
public bool IsButtonVisible
|
||||
public Visibility IsButtonVisible
|
||||
{
|
||||
get { return (bool)GetValue(IsButtonVisibleProperty); }
|
||||
get { return (Visibility)GetValue(IsButtonVisibleProperty); }
|
||||
set { SetValue(IsButtonVisibleProperty, value); }
|
||||
}
|
||||
public static readonly DependencyProperty IsButtonVisibleProperty =
|
||||
DependencyProperty.Register(
|
||||
"IsButtonVisible",
|
||||
typeof(bool),
|
||||
typeof(Visibility),
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata(false, (o, args) => { }));
|
||||
new PropertyMetadata(Visibility.Collapsed, (o, args) => { }));
|
||||
|
||||
public IEnumerable<IPwEntity> ItemsSource
|
||||
{
|
||||
@@ -87,6 +87,18 @@ namespace ModernKeePass.Views.UserControls
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata(new List<IPwEntity>(), (o, args) => { }));
|
||||
|
||||
public object SelectedItem
|
||||
{
|
||||
get { return GetValue(SelectedItemProperty); }
|
||||
set { SetValue(SelectedItemProperty, value); }
|
||||
}
|
||||
public static readonly DependencyProperty SelectedItemProperty =
|
||||
DependencyProperty.Register(
|
||||
"SelectedItem",
|
||||
typeof(object),
|
||||
typeof(HamburgerMenuUserControl),
|
||||
new PropertyMetadata(null, (o, args) => { }));
|
||||
|
||||
public event SelectionChangedEventHandler SelectionChanged;
|
||||
public delegate void SelectionChangedEventHandler(object sender, SelectionChangedEventArgs e);
|
||||
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
Reference in New Issue
Block a user