1st working version in clean arch

WIP Parent group mapping issues
This commit is contained in:
Geoffroy BONNEVILLE
2020-03-30 19:43:04 +02:00
parent d1ba73ee9d
commit e4bd788ed3
54 changed files with 319 additions and 283 deletions

View File

@@ -95,7 +95,7 @@ namespace ModernKeePass.Views.UserControls
if (UpdateKey)
{
await Model.UpdateKey();
ValidationChecked?.Invoke(this, new PasswordEventArgs(new GroupVm(Model.RootGroup, null)));
ValidationChecked?.Invoke(this, new PasswordEventArgs(Model.RootGroup));
}
else
{
@@ -175,7 +175,7 @@ namespace ModernKeePass.Views.UserControls
ButtonLabel = resource.GetResourceValue("CompositeKeyOpening");
if (await Dispatcher.RunTaskAsync(async () => await Model.OpenDatabase(DatabaseFile, CreateNew)))
{
ValidationChecked?.Invoke(this, new PasswordEventArgs(new GroupVm(Model.RootGroup, null)));
ValidationChecked?.Invoke(this, new PasswordEventArgs(Model.RootGroup));
}
ButtonLabel = oldLabel;

View File

@@ -10,7 +10,7 @@
xmlns:converters="using:ModernKeePass.Converters"
mc:Ignorable="d">
<UserControl.Resources>
<converters:IntToSymbolConverter x:Key="IntToSymbolConverter"/>
<converters:IconToSymbolConverter x:Key="IconToSymbolConverter"/>
</UserControl.Resources>
<ListView
ItemsSource="{Binding ItemsSource, ElementName=UserControl}"
@@ -26,7 +26,7 @@
<x:Double x:Key="HamburgerMenuSize">300</x:Double>
<DataTemplate x:Name="IsSpecial">
<StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
</ToolTipService.ToolTip>
@@ -36,7 +36,7 @@
</DataTemplate>
<DataTemplate x:Name="IsNormal">
<StackPanel Orientation="Horizontal">
<SymbolIcon Symbol="{Binding IconId, Converter={StaticResource IntToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<SymbolIcon Symbol="{Binding Icon, Converter={StaticResource IconToSymbolConverter}, ConverterParameter=48}" Margin="7,15,0,15">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Path={Binding DisplayMemberPath, ElementName=UserControl}}" />
</ToolTipService.ToolTip>

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces;
using ModernKeePass.Application.Common.Interfaces;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
@@ -75,18 +75,18 @@ namespace ModernKeePass.Views.UserControls
typeof(HamburgerMenuUserControl),
new PropertyMetadata(Visibility.Collapsed, (o, args) => { }));
public IEnumerable<IVmEntity> ItemsSource
public IEnumerable<IEntityVm> ItemsSource
{
get { return (IEnumerable<IVmEntity>)GetValue(ItemsSourceProperty); }
get { return (IEnumerable<IEntityVm>)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register(
"ItemsSource",
typeof(IEnumerable<IVmEntity>),
typeof(IEnumerable<IEntityVm>),
typeof(HamburgerMenuUserControl),
new PropertyMetadata(new List<IVmEntity>(), (o, args) => { }));
new PropertyMetadata(new List<IEntityVm>(), (o, args) => { }));
public object SelectedItem
{

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ModernKeePass.Converters;
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
@@ -28,8 +27,7 @@ namespace ModernKeePass.Views.UserControls
public SymbolPickerUserControl()
{
InitializeComponent();
var converter = new IntToSymbolConverter();
Symbols = Enum.GetValues(typeof(Symbol)).Cast<Symbol>().Where(s => (int)converter.ConvertBack(s, null, null, string.Empty) != -1);
Symbols = Enum.GetValues(typeof(Symbol)).Cast<Symbol>();
}
private void ComboBox_OnLoaded(object sender, RoutedEventArgs e)