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:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Controls.Primitives;
|
||||||
|
|
||||||
namespace ModernKeePass.Controls
|
namespace ModernKeePass.Controls
|
||||||
{
|
{
|
||||||
@@ -43,6 +44,17 @@ namespace ModernKeePass.Controls
|
|||||||
typeof(TextBoxWithButton),
|
typeof(TextBoxWithButton),
|
||||||
new PropertyMetadata(true, (o, args) => { }));
|
new PropertyMetadata(true, (o, args) => { }));
|
||||||
|
|
||||||
|
public FlyoutBase ButtonFlyout
|
||||||
|
{
|
||||||
|
get { return (FlyoutBase)GetValue(ButtonFlyoutProperty); }
|
||||||
|
set { SetValue(ButtonFlyoutProperty, value); }
|
||||||
|
}
|
||||||
|
public static readonly DependencyProperty ButtonFlyoutProperty =
|
||||||
|
DependencyProperty.Register(
|
||||||
|
"ButtonFlyout",
|
||||||
|
typeof(FlyoutBase),
|
||||||
|
typeof(TextBoxWithButton),
|
||||||
|
new PropertyMetadata(null, (o, args) => { }));
|
||||||
|
|
||||||
protected override void OnApplyTemplate()
|
protected override void OnApplyTemplate()
|
||||||
{
|
{
|
||||||
|
@@ -123,7 +123,6 @@
|
|||||||
<Compile Include="Interfaces\IResourceService.cs" />
|
<Compile Include="Interfaces\IResourceService.cs" />
|
||||||
<Compile Include="Services\SingletonServiceBase.cs" />
|
<Compile Include="Services\SingletonServiceBase.cs" />
|
||||||
<Compile Include="TemplateSelectors\SelectableDataTemplateSelector.cs" />
|
<Compile Include="TemplateSelectors\SelectableDataTemplateSelector.cs" />
|
||||||
<Compile Include="ViewModels\HistoryVm.cs" />
|
|
||||||
<Compile Include="ViewModels\Items\SettingsSaveVm.cs" />
|
<Compile Include="ViewModels\Items\SettingsSaveVm.cs" />
|
||||||
<Compile Include="Views\MainPageFrames\DonatePage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\DonatePage.xaml.cs">
|
||||||
<DependentUpon>DonatePage.xaml</DependentUpon>
|
<DependentUpon>DonatePage.xaml</DependentUpon>
|
||||||
|
@@ -267,4 +267,7 @@
|
|||||||
<data name="RecycleBinTitle" xml:space="preserve">
|
<data name="RecycleBinTitle" xml:space="preserve">
|
||||||
<value>Recycle Bin</value>
|
<value>Recycle Bin</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="EntryCurrent" xml:space="preserve">
|
||||||
|
<value>Current</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@@ -267,4 +267,7 @@
|
|||||||
<data name="RecycleBinTitle" xml:space="preserve">
|
<data name="RecycleBinTitle" xml:space="preserve">
|
||||||
<value>Corbeille</value>
|
<value>Corbeille</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="EntryCurrent" xml:space="preserve">
|
||||||
|
<value>Courante</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@@ -16,13 +16,13 @@
|
|||||||
<Canvas.Projection>
|
<Canvas.Projection>
|
||||||
<PlaneProjection/>
|
<PlaneProjection/>
|
||||||
</Canvas.Projection>
|
</Canvas.Projection>
|
||||||
<Path x:Name="path" Data="M0,12.997 L30,12.997" Height="3" Stretch="Fill" StrokeThickness="3" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" RenderTransformOrigin="0.5,0.5">
|
<Path x:Name="path" Data="M0,12.997 L30,12.997" Height="2" Stretch="Fill" StrokeThickness="2" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" RenderTransformOrigin="0.5,0.5">
|
||||||
<Path.RenderTransform>
|
<Path.RenderTransform>
|
||||||
<CompositeTransform/>
|
<CompositeTransform/>
|
||||||
</Path.RenderTransform>
|
</Path.RenderTransform>
|
||||||
</Path>
|
</Path>
|
||||||
<Path Data="M0,12.997 L30,12.997" Height="3" Stretch="Fill" StrokeThickness="3" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Canvas.Top="7"/>
|
<Path Data="M0,12.997 L30,12.997" Height="2" Stretch="Fill" StrokeThickness="2" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Canvas.Top="7"/>
|
||||||
<Path x:Name="path1" Data="M0,12.997 L30,12.997" Height="3" Stretch="Fill" StrokeThickness="3" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Canvas.Top="14" RenderTransformOrigin="0.5,0.5">
|
<Path x:Name="path1" Data="M0,12.997 L30,12.997" Height="2" Stretch="Fill" StrokeThickness="2" Width="28" Stroke="{ThemeResource DefaultTextForegroundThemeBrush}" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Canvas.Top="14" RenderTransformOrigin="0.5,0.5">
|
||||||
<Path.RenderTransform>
|
<Path.RenderTransform>
|
||||||
<CompositeTransform/>
|
<CompositeTransform/>
|
||||||
</Path.RenderTransform>
|
</Path.RenderTransform>
|
||||||
|
@@ -246,6 +246,9 @@
|
|||||||
Content="{TemplateBinding ButtonSymbol}"
|
Content="{TemplateBinding ButtonSymbol}"
|
||||||
IsEnabled="{TemplateBinding IsButtonEnabled}"
|
IsEnabled="{TemplateBinding IsButtonEnabled}"
|
||||||
VerticalAlignment="Stretch">
|
VerticalAlignment="Stretch">
|
||||||
|
<Button.Flyout>
|
||||||
|
<Flyout Content="{TemplateBinding ButtonFlyout}" />
|
||||||
|
</Button.Flyout>
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{TemplateBinding ButtonTooltip}" />
|
<ToolTip Content="{TemplateBinding ButtonTooltip}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Globalization;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
using ModernKeePass.Services;
|
using ModernKeePass.Services;
|
||||||
using ModernKeePassLib;
|
using ModernKeePassLib;
|
||||||
@@ -10,7 +11,7 @@ using ModernKeePassLib.Cryptography;
|
|||||||
|
|
||||||
namespace ModernKeePass.ViewModels
|
namespace ModernKeePass.ViewModels
|
||||||
{
|
{
|
||||||
public class EntryVm : INotifyPropertyChanged, IPwEntity
|
public class EntryVm : INotifyPropertyChanged, IPwEntity, ISelectableModel
|
||||||
{
|
{
|
||||||
public GroupVm ParentGroup { get; private set; }
|
public GroupVm ParentGroup { get; private set; }
|
||||||
public GroupVm PreviousGroup { get; private set; }
|
public GroupVm PreviousGroup { get; private set; }
|
||||||
@@ -19,7 +20,6 @@ namespace ModernKeePass.ViewModels
|
|||||||
public bool IsRevealPasswordEnabled => !string.IsNullOrEmpty(Password);
|
public bool IsRevealPasswordEnabled => !string.IsNullOrEmpty(Password);
|
||||||
public bool HasExpired => HasExpirationDate && _pwEntry.ExpiryTime < DateTime.Now;
|
public bool HasExpired => HasExpirationDate && _pwEntry.ExpiryTime < DateTime.Now;
|
||||||
public double PasswordComplexityIndicator => QualityEstimation.EstimatePasswordBits(Password?.ToCharArray());
|
public double PasswordComplexityIndicator => QualityEstimation.EstimatePasswordBits(Password?.ToCharArray());
|
||||||
public bool IsFirstItem => _pwEntry == null;
|
|
||||||
public bool UpperCasePatternSelected { get; set; } = true;
|
public bool UpperCasePatternSelected { get; set; } = true;
|
||||||
public bool LowerCasePatternSelected { get; set; } = true;
|
public bool LowerCasePatternSelected { get; set; } = true;
|
||||||
public bool DigitsPatternSelected { get; set; } = true;
|
public bool DigitsPatternSelected { get; set; } = true;
|
||||||
@@ -33,6 +33,10 @@ namespace ModernKeePass.ViewModels
|
|||||||
public string Id => _pwEntry?.Uuid.ToHexString();
|
public string Id => _pwEntry?.Uuid.ToHexString();
|
||||||
public bool IsRecycleOnDelete => _database.RecycleBinEnabled && !ParentGroup.IsSelected;
|
public bool IsRecycleOnDelete => _database.RecycleBinEnabled && !ParentGroup.IsSelected;
|
||||||
public IEnumerable<IPwEntity> BreadCrumb => new List<IPwEntity>(ParentGroup.BreadCrumb) {ParentGroup};
|
public IEnumerable<IPwEntity> BreadCrumb => new List<IPwEntity>(ParentGroup.BreadCrumb) {ParentGroup};
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if the Entry is current or from history
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSelected { get; set; } = true;
|
||||||
|
|
||||||
public double PasswordLength
|
public double PasswordLength
|
||||||
{
|
{
|
||||||
@@ -73,6 +77,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
get { return GetEntryValue(PwDefs.UrlField); }
|
get { return GetEntryValue(PwDefs.UrlField); }
|
||||||
set { SetEntryValue(PwDefs.UrlField, value); }
|
set { SetEntryValue(PwDefs.UrlField, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Notes
|
public string Notes
|
||||||
{
|
{
|
||||||
get { return GetEntryValue(PwDefs.NotesField); }
|
get { return GetEntryValue(PwDefs.NotesField); }
|
||||||
@@ -102,7 +107,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
|
|
||||||
public bool IsEditMode
|
public bool IsEditMode
|
||||||
{
|
{
|
||||||
get { return _isEditMode; }
|
get { return IsSelected && _isEditMode; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_isEditMode = value;
|
_isEditMode = value;
|
||||||
@@ -143,10 +148,13 @@ namespace ModernKeePass.ViewModels
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
var history = new List<EntryVm> {this};
|
||||||
foreach (var historyEntry in _pwEntry.History)
|
foreach (var historyEntry in _pwEntry.History)
|
||||||
{
|
{
|
||||||
yield return new EntryVm(historyEntry, ParentGroup);
|
history.Add(new EntryVm(historyEntry, ParentGroup) {IsSelected = false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return history;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,6 +162,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
|
|
||||||
private readonly PwEntry _pwEntry;
|
private readonly PwEntry _pwEntry;
|
||||||
private readonly IDatabaseService _database;
|
private readonly IDatabaseService _database;
|
||||||
|
private readonly IResourceService _resource;
|
||||||
private bool _isEditMode;
|
private bool _isEditMode;
|
||||||
private bool _isRevealPassword;
|
private bool _isRevealPassword;
|
||||||
private double _passwordLength = 25;
|
private double _passwordLength = 25;
|
||||||
@@ -166,11 +175,12 @@ namespace ModernKeePass.ViewModels
|
|||||||
|
|
||||||
public EntryVm() { }
|
public EntryVm() { }
|
||||||
|
|
||||||
internal EntryVm(PwEntry entry, GroupVm parent) : this(entry, parent, DatabaseService.Instance) { }
|
internal EntryVm(PwEntry entry, GroupVm parent) : this(entry, parent, DatabaseService.Instance, new ResourcesService()) { }
|
||||||
|
|
||||||
public EntryVm(PwEntry entry, GroupVm parent, IDatabaseService database)
|
public EntryVm(PwEntry entry, GroupVm parent, IDatabaseService database, IResourceService resource)
|
||||||
{
|
{
|
||||||
_database = database;
|
_database = database;
|
||||||
|
_resource = resource;
|
||||||
_pwEntry = entry;
|
_pwEntry = entry;
|
||||||
ParentGroup = parent;
|
ParentGroup = parent;
|
||||||
}
|
}
|
||||||
@@ -254,5 +264,10 @@ namespace ModernKeePass.ViewModels
|
|||||||
{
|
{
|
||||||
return _pwEntry;
|
return _pwEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return IsSelected ? _resource.GetResourceValue("EntryCurrent") : _pwEntry.LastModificationTime.ToString("g");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
public bool ShowRestore => IsNotRoot && ParentGroup.IsSelected;
|
public bool ShowRestore => IsNotRoot && ParentGroup.IsSelected;
|
||||||
|
|
||||||
public bool IsRecycleOnDelete => _database.RecycleBinEnabled && !IsSelected && !ParentGroup.IsSelected;
|
public bool IsRecycleOnDelete => _database.RecycleBinEnabled && !IsSelected && !ParentGroup.IsSelected;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is the Group the database Recycle Bin?
|
/// Is the Group the database Recycle Bin?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using ModernKeePass.Interfaces;
|
|
||||||
|
|
||||||
namespace ModernKeePass.ViewModels
|
|
||||||
{
|
|
||||||
public class HistoryVm: IHasSelectableObject
|
|
||||||
{
|
|
||||||
public IEnumerable<IPwEntity> History { get; }
|
|
||||||
|
|
||||||
public HistoryVm() { }
|
|
||||||
|
|
||||||
public HistoryVm(IEnumerable<IPwEntity> history)
|
|
||||||
{
|
|
||||||
History = history;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISelectableModel SelectedItem { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@@ -429,13 +429,13 @@
|
|||||||
<RowDefinition Height="50"/>
|
<RowDefinition Height="50"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid Grid.Row="1">
|
<Grid Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
|
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<userControls:HamburgerMenuUserControl x:Uid="HistoryLeftListView" ItemsSource="{Binding History}" ResizeTarget="{Binding ElementName=LeftListViewColumn}" />
|
<userControls:HamburgerMenuUserControl x:Name="HamburgerMenu" x:Uid="HistoryLeftListView" ItemsSource="{Binding History}" ResizeTarget="{Binding ElementName=LeftListViewColumn}" SelectionChanged="HamburgerMenuUserControl_OnSelectionChanged" />
|
||||||
<StackPanel Grid.Column="1" Margin="20,0,0,0" >
|
<StackPanel x:Name="StackPanel" Grid.Column="1" Margin="20,0,0,0">
|
||||||
<StackPanel.Resources>
|
<StackPanel.Resources>
|
||||||
<Style TargetType="TextBlock">
|
<Style TargetType="TextBlock">
|
||||||
<Setter Property="Margin" Value="0,20,0,0"/>
|
<Setter Property="Margin" Value="0,20,0,0"/>
|
||||||
@@ -444,17 +444,17 @@
|
|||||||
<Setter Property="Margin" Value="0,20,0,0"/>
|
<Setter Property="Margin" Value="0,20,0,0"/>
|
||||||
</Style>
|
</Style>
|
||||||
</StackPanel.Resources>
|
</StackPanel.Resources>
|
||||||
<TextBlock x:Uid="EntryLogin" TextWrapping="Wrap" FontSize="18"/>
|
<TextBlock x:Uid="EntryLogin" TextWrapping="Wrap" FontSize="18" />
|
||||||
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding UserName, Mode=TwoWay}" Width="350" Height="32" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Copy">
|
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding UserName, Mode=TwoWay}" Width="350" Height="32" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Copy" IsEnabled="{Binding IsSelected}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="ButtonClick">
|
<core:EventTriggerBehavior EventName="ButtonClick">
|
||||||
<actions:ClipboardAction Text="{Binding UserName}" />
|
<actions:ClipboardAction Text="{Binding UserName}" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</local:TextBoxWithButton>
|
</local:TextBoxWithButton>
|
||||||
<TextBlock x:Uid="EntryPassword" TextWrapping="Wrap" FontSize="18"/>
|
<TextBlock x:Uid="EntryPassword" TextWrapping="Wrap" FontSize="18" />
|
||||||
<PasswordBox HorizontalAlignment="Left" Password="{Binding Password, Mode=TwoWay}" Width="350" Height="32" IsPasswordRevealButtonEnabled="True" Visibility="{Binding IsRevealPassword, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Style="{StaticResource PasswordBoxWithButtonStyle}" />
|
<PasswordBox HorizontalAlignment="Left" Password="{Binding Password, Mode=TwoWay}" Width="350" Height="32" IsPasswordRevealButtonEnabled="True" Visibility="{Binding IsRevealPassword, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Style="{StaticResource PasswordBoxWithButtonStyle}" IsEnabled="{Binding IsSelected}" />
|
||||||
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding Password, Mode=TwoWay}" Width="350" Height="32" Visibility="{Binding IsRevealPassword, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Copy">
|
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding Password, Mode=TwoWay}" Width="350" Height="32" Visibility="{Binding IsRevealPassword, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Copy" IsEnabled="{Binding IsSelected}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="ButtonClick">
|
<core:EventTriggerBehavior EventName="ButtonClick">
|
||||||
<actions:ClipboardAction Text="{Binding Password}" />
|
<actions:ClipboardAction Text="{Binding Password}" />
|
||||||
@@ -464,7 +464,7 @@
|
|||||||
<ProgressBar Value="{Binding PasswordComplexityIndicator, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}" Maximum="128" Width="350" HorizontalAlignment="Left" Foreground="{Binding PasswordComplexityIndicator, ConverterParameter=128, Converter={StaticResource DoubleToForegroungBrushComplexityConverter}}" />
|
<ProgressBar Value="{Binding PasswordComplexityIndicator, ConverterParameter=0\,128, Converter={StaticResource ProgressBarLegalValuesConverter}}" Maximum="128" Width="350" HorizontalAlignment="Left" Foreground="{Binding PasswordComplexityIndicator, ConverterParameter=128, Converter={StaticResource DoubleToForegroungBrushComplexityConverter}}" />
|
||||||
<CheckBox x:Uid="EntryShowPassword" HorizontalAlignment="Left" Margin="-3,0,0,0" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}" IsEnabled="{Binding IsRevealPasswordEnabled}" />
|
<CheckBox x:Uid="EntryShowPassword" HorizontalAlignment="Left" Margin="-3,0,0,0" IsChecked="{Binding IsRevealPassword, Mode=TwoWay}" IsEnabled="{Binding IsRevealPasswordEnabled}" />
|
||||||
<TextBlock TextWrapping="Wrap" Text="URL" FontSize="18"/>
|
<TextBlock TextWrapping="Wrap" Text="URL" FontSize="18"/>
|
||||||
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding Url, Mode=TwoWay}" Height="32" Width="350" MaxLength="256" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Navigate to URL">
|
<local:TextBoxWithButton HorizontalAlignment="Left" Text="{Binding Url, Mode=TwoWay}" Height="32" Width="350" MaxLength="256" Style="{StaticResource TextBoxWithButtonStyle}" ButtonSymbol="" ButtonTooltip="Navigate to URL" IsEnabled="{Binding IsSelected}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="ButtonClick">
|
<core:EventTriggerBehavior EventName="ButtonClick">
|
||||||
<actions:NavigateToUrlAction Url="{Binding Url}" />
|
<actions:NavigateToUrlAction Url="{Binding Url}" />
|
||||||
@@ -472,8 +472,8 @@
|
|||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</local:TextBoxWithButton>
|
</local:TextBoxWithButton>
|
||||||
<TextBlock x:Uid="EntryNotes" TextWrapping="Wrap" FontSize="18" />
|
<TextBlock x:Uid="EntryNotes" TextWrapping="Wrap" FontSize="18" />
|
||||||
<TextBox HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Notes, Mode=TwoWay}" Width="350" Height="200" AcceptsReturn="True" IsSpellCheckEnabled="True" />
|
<TextBox HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Notes, Mode=TwoWay}" Width="350" Height="200" AcceptsReturn="True" IsSpellCheckEnabled="True" IsEnabled="{Binding IsSelected}" />
|
||||||
<CheckBox x:Uid="EntryExpirationDate" FontSize="18" IsChecked="{Binding HasExpirationDate, Mode=TwoWay}" />
|
<CheckBox x:Uid="EntryExpirationDate" FontSize="18" IsChecked="{Binding HasExpirationDate, Mode=TwoWay}" IsEnabled="{Binding IsSelected}" />
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
|
@@ -97,5 +97,21 @@ namespace ModernKeePass.Views
|
|||||||
{
|
{
|
||||||
VisualStateManager.GoToState(this, e.NewSize.Width < 700 ? "Small" : "Large", true);
|
VisualStateManager.GoToState(this, e.NewSize.Width < 700 ? "Small" : "Large", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HamburgerMenuUserControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var listView = sender as ListView;
|
||||||
|
EntryVm entry;
|
||||||
|
switch (listView?.SelectedIndex)
|
||||||
|
{
|
||||||
|
case -1:
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
entry = listView?.SelectedItem as EntryVm;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
StackPanel.DataContext = entry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -116,7 +116,7 @@
|
|||||||
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
|
<ColumnDefinition Width="50" x:Name="LeftListViewColumn" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<userControls:HamburgerMenuUserControl x:Uid="GroupsLeftListView" ItemsSource="{Binding Groups}" DisplayMemberPath="Name" SelectionChanged="groups_SelectionChanged" ButtonClicked="CreateGroup_ButtonClick" ResizeTarget="{Binding ElementName=LeftListViewColumn}" IsButtonVisible="{Binding IsSelected}" />
|
<userControls:HamburgerMenuUserControl x:Uid="GroupsLeftListView" ItemsSource="{Binding Groups}" SelectionChanged="groups_SelectionChanged" ButtonClicked="CreateGroup_ButtonClick" ResizeTarget="{Binding ElementName=LeftListViewColumn}" IsButtonVisible="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" />
|
||||||
<TextBlock Grid.Column="1" x:Uid="ReorderEntriesLabel" Margin="20,20,0,0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource BodyTextBlockStyle}" />
|
<TextBlock Grid.Column="1" x:Uid="ReorderEntriesLabel" Margin="20,20,0,0" Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
<HyperlinkButton Grid.Column="1" VerticalAlignment="Top" Margin="40,10,0,0" Click="CreateEntry_ButtonClick" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}">
|
<HyperlinkButton Grid.Column="1" VerticalAlignment="Top" Margin="40,10,0,0" Click="CreateEntry_ButtonClick" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
@@ -10,21 +10,22 @@
|
|||||||
xmlns:converters="using:ModernKeePass.Converters"
|
xmlns:converters="using:ModernKeePass.Converters"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
|
|
||||||
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/>
|
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<ListView
|
<ListView
|
||||||
ItemsSource="{Binding ItemsSource, ElementName=UserControl}"
|
ItemsSource="{Binding ItemsSource, ElementName=UserControl}"
|
||||||
SelectionChanged="Selector_OnSelectionChanged"
|
SelectionChanged="Selector_OnSelectionChanged"
|
||||||
|
SelectedItem="{Binding SelectedItem, ElementName=UserControl}"
|
||||||
IsSwipeEnabled="false"
|
IsSwipeEnabled="false"
|
||||||
IsSynchronizedWithCurrentItem="False"
|
IsSynchronizedWithCurrentItem="False"
|
||||||
RequestedTheme="Dark"
|
RequestedTheme="Dark"
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||||
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}">
|
Foreground="{ThemeResource DefaultTextForegroundThemeBrush}"
|
||||||
|
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||||
<ListView.Resources>
|
<ListView.Resources>
|
||||||
<DataTemplate x:Name="IsSpecial">
|
<DataTemplate x:Name="IsSpecial">
|
||||||
<StackPanel Orientation="Horizontal">
|
<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>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate x:Name="IsNormal">
|
<DataTemplate x:Name="IsNormal">
|
||||||
<StackPanel Orientation="Horizontal">
|
<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>
|
<ToolTipService.ToolTip>
|
||||||
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
@@ -46,14 +47,6 @@
|
|||||||
<ListView.ItemTemplateSelector>
|
<ListView.ItemTemplateSelector>
|
||||||
<templateSelectors:SelectableDataTemplateSelector FalseItem="{StaticResource IsNormal}" TrueItem="{StaticResource IsSpecial}" />
|
<templateSelectors:SelectableDataTemplateSelector FalseItem="{StaticResource IsNormal}" TrueItem="{StaticResource IsSpecial}" />
|
||||||
</ListView.ItemTemplateSelector>
|
</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>
|
<ListView.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@@ -76,7 +69,7 @@
|
|||||||
</ListView.HeaderTemplate>
|
</ListView.HeaderTemplate>
|
||||||
<ListView.FooterTemplate>
|
<ListView.FooterTemplate>
|
||||||
<DataTemplate>
|
<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" />
|
<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">
|
<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">
|
<StackPanel Orientation="Horizontal" Margin="13,0,5,0">
|
||||||
|
@@ -48,7 +48,7 @@ namespace ModernKeePass.Views.UserControls
|
|||||||
"DisplayMemberPath",
|
"DisplayMemberPath",
|
||||||
typeof(string),
|
typeof(string),
|
||||||
typeof(HamburgerMenuUserControl),
|
typeof(HamburgerMenuUserControl),
|
||||||
new PropertyMetadata("Name", (o, args) => { }));
|
new PropertyMetadata("Title", (o, args) => { }));
|
||||||
|
|
||||||
public object ResizeTarget
|
public object ResizeTarget
|
||||||
{
|
{
|
||||||
@@ -62,17 +62,17 @@ namespace ModernKeePass.Views.UserControls
|
|||||||
typeof(HamburgerMenuUserControl),
|
typeof(HamburgerMenuUserControl),
|
||||||
new PropertyMetadata(null, (o, args) => { }));
|
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); }
|
set { SetValue(IsButtonVisibleProperty, value); }
|
||||||
}
|
}
|
||||||
public static readonly DependencyProperty IsButtonVisibleProperty =
|
public static readonly DependencyProperty IsButtonVisibleProperty =
|
||||||
DependencyProperty.Register(
|
DependencyProperty.Register(
|
||||||
"IsButtonVisible",
|
"IsButtonVisible",
|
||||||
typeof(bool),
|
typeof(Visibility),
|
||||||
typeof(HamburgerMenuUserControl),
|
typeof(HamburgerMenuUserControl),
|
||||||
new PropertyMetadata(false, (o, args) => { }));
|
new PropertyMetadata(Visibility.Collapsed, (o, args) => { }));
|
||||||
|
|
||||||
public IEnumerable<IPwEntity> ItemsSource
|
public IEnumerable<IPwEntity> ItemsSource
|
||||||
{
|
{
|
||||||
@@ -87,6 +87,18 @@ namespace ModernKeePass.Views.UserControls
|
|||||||
typeof(HamburgerMenuUserControl),
|
typeof(HamburgerMenuUserControl),
|
||||||
new PropertyMetadata(new List<IPwEntity>(), (o, args) => { }));
|
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 event SelectionChangedEventHandler SelectionChanged;
|
||||||
public delegate void SelectionChangedEventHandler(object sender, SelectionChangedEventArgs e);
|
public delegate void SelectionChangedEventHandler(object sender, SelectionChangedEventArgs e);
|
||||||
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
Reference in New Issue
Block a user