mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP ViewModelLocator - Messenger and Recent issues
Refactoring Code cleanup
This commit is contained in:
@@ -3,6 +3,7 @@ using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using ModernKeePass.Common;
|
||||
using ModernKeePass.Domain.Interfaces;
|
||||
|
||||
|
@@ -22,15 +22,6 @@ namespace ModernKeePass.Views
|
||||
|
||||
#region Inscription de NavigationHelper
|
||||
|
||||
/// Les méthodes fournies dans cette section sont utilisées simplement pour permettre
|
||||
/// NavigationHelper pour répondre aux méthodes de navigation de la page.
|
||||
///
|
||||
/// La logique spécifique à la page doit être placée dans les gestionnaires d'événements pour
|
||||
/// <see cref="Common.NavigationHelper.LoadState"/>
|
||||
/// et <see cref="Common.NavigationHelper.SaveState"/>.
|
||||
/// Le paramètre de navigation est disponible dans la méthode LoadState
|
||||
/// en plus de l'état de page conservé durant une session antérieure.
|
||||
|
||||
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
var args = e.Parameter as NavigationItem;
|
||||
|
@@ -37,16 +37,7 @@ namespace ModernKeePass.Views
|
||||
}
|
||||
|
||||
#region NavigationHelper registration
|
||||
|
||||
/// The methods provided in this section are simply used to allow
|
||||
/// NavigationHelper to respond to the page's navigation methods.
|
||||
///
|
||||
/// Page specific logic should be placed in event handlers for the
|
||||
/// <see cref="Common.NavigationHelper.LoadState"/>
|
||||
/// and <see cref="Common.NavigationHelper.SaveState"/>.
|
||||
/// The navigation parameter is available in the LoadState method
|
||||
/// in addition to page state preserved during an earlier session.
|
||||
///
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
var navigationItem = e.Parameter as NavigationItem;
|
||||
|
@@ -18,10 +18,16 @@ namespace ModernKeePass.Views
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Unloaded += MainPage_Unloaded;
|
||||
ListView = MenuListView;
|
||||
ListViewSource = MenuItemsSource;
|
||||
}
|
||||
|
||||
private void MainPage_Unloaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
Model.Cleanup();
|
||||
}
|
||||
|
||||
private new void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
base.ListView_SelectionChanged(sender, e);
|
||||
|
@@ -5,15 +5,14 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=New}">
|
||||
<Page.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<viewModels:NewVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<HyperlinkButton x:Uid="NewCreateButton" Click="CreateDatabaseButton_OnClick" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}" />
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30" x:Uid="NewCreateDesc" />
|
||||
<Border HorizontalAlignment="Left" BorderThickness="1" BorderBrush="AliceBlue" Width="550" Visibility="{Binding IsFileSelected, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
|
@@ -20,7 +20,7 @@ namespace ModernKeePass.Views
|
||||
public sealed partial class NewDatabasePage
|
||||
{
|
||||
private readonly IResourceProxy _resource;
|
||||
private NewVm Model => (NewVm)Resources["ViewModel"];
|
||||
private NewVm Model => (NewVm)DataContext;
|
||||
|
||||
public NewDatabasePage(): this(App.Services.GetRequiredService<IResourceProxy>()) { }
|
||||
public NewDatabasePage(IResourceProxy resource)
|
||||
@@ -41,7 +41,7 @@ namespace ModernKeePass.Views
|
||||
var file = await savePicker.PickSaveFileAsync().AsTask();
|
||||
if (file == null) return;
|
||||
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
var fileInfo = new FileInfo
|
||||
{
|
||||
Id = token,
|
||||
|
@@ -3,17 +3,16 @@
|
||||
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:userControls="using:ModernKeePass.Views.UserControls"
|
||||
x:Class="ModernKeePass.Views.OpenDatabasePage"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Open}">
|
||||
<Page.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<viewModels:OpenVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<HyperlinkButton x:Uid="OpenBrowseButton" Click="ButtonBase_OnClick" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}" />
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30" x:Uid="OpenBrowseDesc" />
|
||||
<!--<HyperlinkButton x:Uid="OpenUrlButton" IsEnabled="False" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}" />
|
||||
|
@@ -3,13 +3,7 @@ using Windows.Storage.AccessCache;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using GalaSoft.MvvmLight.Views;
|
||||
using Messages;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ModernKeePass.Common;
|
||||
using ModernKeePass.Domain.Dtos;
|
||||
using ModernKeePass.Models;
|
||||
using ModernKeePass.ViewModels;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
@@ -21,24 +15,11 @@ namespace ModernKeePass.Views
|
||||
/// </summary>
|
||||
public sealed partial class OpenDatabasePage
|
||||
{
|
||||
private readonly INavigationService _navigation;
|
||||
private OpenVm Model => (OpenVm)Resources["ViewModel"];
|
||||
|
||||
public OpenDatabasePage(): this(
|
||||
App.Services.GetRequiredService<INavigationService>(),
|
||||
App.Services.GetRequiredService<IMessenger>()) { }
|
||||
|
||||
public OpenDatabasePage(INavigationService navigation, IMessenger messenger)
|
||||
private OpenVm Model => (OpenVm)DataContext;
|
||||
|
||||
public OpenDatabasePage()
|
||||
{
|
||||
_navigation = navigation;
|
||||
InitializeComponent();
|
||||
|
||||
messenger.Register<DatabaseOpenedMessage>(this, NavigateToPage);
|
||||
}
|
||||
|
||||
private void NavigateToPage(DatabaseOpenedMessage message)
|
||||
{
|
||||
_navigation.NavigateTo(Constants.Navigation.GroupPage, new NavigationItem { Id = message.RootGroupId });
|
||||
}
|
||||
|
||||
protected override async void OnNavigatedTo(NavigationEventArgs e)
|
||||
@@ -64,8 +45,7 @@ namespace ModernKeePass.Views
|
||||
var file = await picker.PickSingleFileAsync().AsTask();
|
||||
if (file == null) return;
|
||||
|
||||
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
var fileInfo = new FileInfo
|
||||
{
|
||||
Path = file.Path,
|
||||
|
@@ -3,16 +3,15 @@
|
||||
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:userControls="using:ModernKeePass.Views.UserControls"
|
||||
x:Class="ModernKeePass.Views.RecentDatabasesPage"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Recent}">
|
||||
<Page.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<viewModels:RecentVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
<Grid x:Name="Grid" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<Grid x:Name="Grid" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
|
@@ -1,11 +1,5 @@
|
||||
// Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using GalaSoft.MvvmLight.Views;
|
||||
using Messages;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ModernKeePass.Common;
|
||||
using ModernKeePass.Models;
|
||||
using ModernKeePass.ViewModels;
|
||||
|
||||
namespace ModernKeePass.Views
|
||||
@@ -15,29 +9,11 @@ namespace ModernKeePass.Views
|
||||
/// </summary>
|
||||
public sealed partial class RecentDatabasesPage
|
||||
{
|
||||
private RecentVm Model => (RecentVm)Resources["ViewModel"];
|
||||
|
||||
private readonly INavigationService _navigation;
|
||||
private readonly IMessenger _messenger;
|
||||
|
||||
public RecentDatabasesPage(): this(
|
||||
App.Services.GetRequiredService<INavigationService>(),
|
||||
App.Services.GetRequiredService<IMessenger>())
|
||||
{ }
|
||||
|
||||
public RecentDatabasesPage(INavigationService navigation, IMessenger messenger)
|
||||
{
|
||||
_navigation = navigation;
|
||||
_messenger = messenger;
|
||||
InitializeComponent();
|
||||
|
||||
messenger.Register<DatabaseOpeningMessage>(this, action => Model.UpdateAccessTime(action.Token));
|
||||
messenger.Register<DatabaseOpenedMessage>(this, NavigateToPage);
|
||||
}
|
||||
private RecentVm Model => (RecentVm)DataContext;
|
||||
|
||||
private void NavigateToPage(DatabaseOpenedMessage message)
|
||||
public RecentDatabasesPage()
|
||||
{
|
||||
_navigation.NavigateTo(Constants.Navigation.GroupPage, new NavigationItem { Id = message.RootGroupId });
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,12 +3,9 @@
|
||||
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"
|
||||
x:Class="ModernKeePass.Views.SaveDatabasePage"
|
||||
mc:Ignorable="d">
|
||||
<Page.DataContext>
|
||||
<viewModels:SaveVm/>
|
||||
</Page.DataContext>
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Save}">
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<HyperlinkButton x:Uid="SaveButton" Command="{Binding SaveCommand}" Foreground="{StaticResource MainColor}" Style="{StaticResource MainColorHyperlinkButton}" />
|
||||
|
@@ -4,17 +4,14 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="using:ModernKeePass.Controls"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
xmlns:basePages="using:ModernKeePass.Views.BasePages"
|
||||
x:Name="PageRoot"
|
||||
x:Class="ModernKeePass.Views.SettingsPage"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=Settings}">
|
||||
<Page.Resources>
|
||||
<CollectionViewSource x:Name="MenuItemsSource" Source="{Binding MenuItems}" IsSourceGrouped="True" />
|
||||
</Page.Resources>
|
||||
<Page.DataContext>
|
||||
<viewModels:SettingsVm />
|
||||
</Page.DataContext>
|
||||
|
||||
<Page.Background>
|
||||
<StaticResource ResourceKey="ApplicationPageBackgroundThemeBrush"/>
|
||||
|
@@ -5,12 +5,11 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
xmlns:listItems="using:ModernKeePass.ViewModels.ListItems"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=SettingsDatabase}">
|
||||
<Page.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
<converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/>
|
||||
<listItems:SettingsDatabaseVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
|
@@ -4,13 +4,10 @@
|
||||
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:listItems="using:ModernKeePass.ViewModels.ListItems"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<listItems:SettingsNewVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=SettingsNew}">
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<StackPanel.Resources>
|
||||
<CollectionViewSource x:Name="KeyDerivations" Source="{Binding FileFormats}" />
|
||||
</StackPanel.Resources>
|
||||
|
@@ -4,13 +4,10 @@
|
||||
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:listItems="using:ModernKeePass.ViewModels.ListItems"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<listItems:SettingsSaveVm x:Name="ViewModel"/>
|
||||
</Page.Resources>
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=SettingsSave}">
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock x:Uid="SettingsSaveDatabaseSuspendTitle" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,0,0,10"/>
|
||||
<TextBlock x:Uid="SettingsSaveDatabaseSuspendDesc" TextWrapping="WrapWholeWords" Margin="5,0,0,10"/>
|
||||
<ToggleSwitch x:Uid="SettingsSaveDatabaseSuspend" IsOn="{Binding IsSaveSuspend, Mode=TwoWay}" Style="{StaticResource MainColorToggleSwitch}" />
|
||||
|
@@ -5,13 +5,10 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||
xmlns:listItems="using:ModernKeePass.ViewModels.ListItems"
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<listItems:SettingsSecurityVm x:Key="ViewModel"/>
|
||||
</Page.Resources>
|
||||
mc:Ignorable="d"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=SettingsSecurity}">
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" DataContext="{StaticResource ViewModel}">
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock x:Uid="SettingsSecurityTitle" Style="{StaticResource TextBlockSettingsHeaderStyle}" Margin="5,0,0,0" />
|
||||
<TextBlock TextWrapping="WrapWholeWords" Margin="5,0,0,0">
|
||||
<Run x:Uid="SettingsSecurityDesc1" />
|
||||
|
@@ -7,14 +7,12 @@
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
mc:Ignorable="d" >
|
||||
<UserControl.Resources>
|
||||
<converters:DiscreteIntToSolidColorBrushConverter x:Key="DiscreteIntToSolidColorBrushConverter"/>
|
||||
<converters:EmptyStringToVisibilityConverter x:Key="EmptyStringToVisibilityConverter"/>
|
||||
<viewModels:OpenDatabaseControlVm x:Key="ViewModel"/>
|
||||
</UserControl.Resources>
|
||||
<Grid DataContext="{StaticResource ViewModel}">
|
||||
<Grid x:Name="Grid" DataContext="{Binding Source={StaticResource Locator}, Path=OpenDatabaseControl}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
@@ -12,7 +12,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
{
|
||||
public sealed partial class OpenDatabaseUserControl
|
||||
{
|
||||
private OpenDatabaseControlVm Model => (OpenDatabaseControlVm)Resources["ViewModel"];
|
||||
private OpenDatabaseControlVm Model => (OpenDatabaseControlVm)Grid.DataContext;
|
||||
|
||||
public string DatabaseFilePath
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
var file = await picker.PickSingleFileAsync();
|
||||
if (file == null) return;
|
||||
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
Model.KeyFilePath = token;
|
||||
Model.KeyFileText = file.DisplayName;
|
||||
}
|
||||
|
@@ -7,16 +7,14 @@
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:converters="using:ModernKeePass.Converters"
|
||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||
mc:Ignorable="d" >
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<converters:ProgressBarLegalValuesConverter x:Key="ProgressBarLegalValuesConverter"/>
|
||||
<converters:DoubleToSolidColorBrushConverter x:Key="DoubleToSolidColorBrushConverter"/>
|
||||
<converters:DiscreteIntToSolidColorBrushConverter x:Key="DiscreteIntToSolidColorBrushConverter"/>
|
||||
<converters:EmptyStringToVisibilityConverter x:Key="EmptyStringToVisibilityConverter"/>
|
||||
<viewModels:SetCredentialsVm x:Key="ViewModel"/>
|
||||
</UserControl.Resources>
|
||||
<Grid DataContext="{StaticResource ViewModel}">
|
||||
<Grid x:Name="Grid" DataContext="{Binding Source={StaticResource Locator}, Path=SetCredentials}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
@@ -11,7 +11,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
{
|
||||
public sealed partial class SetCredentialsUserControl
|
||||
{
|
||||
private SetCredentialsVm Model => (SetCredentialsVm)Resources["ViewModel"];
|
||||
private SetCredentialsVm Model => (SetCredentialsVm)Grid.DataContext;
|
||||
|
||||
public string ButtonLabel
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
var file = await picker.PickSingleFileAsync();
|
||||
if (file == null) return;
|
||||
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
Model.KeyFilePath = token;
|
||||
Model.KeyFileText = file.DisplayName;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
var file = await savePicker.PickSaveFileAsync();
|
||||
if (file == null) return;
|
||||
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file);
|
||||
var token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
Model.KeyFilePath = token;
|
||||
Model.KeyFileText = file.DisplayName;
|
||||
await Model.GenerateKeyFile();
|
||||
|
Reference in New Issue
Block a user