mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Save error is now handled via Messenger instead of unhandled exception handler (which didn't work)
Save as actually works now WIP Styles Code cleanup
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using Windows.Storage.AccessCache;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using ModernKeePass.Domain.Dtos;
|
||||
using ModernKeePass.ViewModels;
|
||||
|
||||
@@ -26,31 +22,7 @@ namespace ModernKeePass.Views
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
var file = e.Parameter as FileInfo;
|
||||
if (file != null)
|
||||
{
|
||||
Model.Path = file.Path;
|
||||
Model.Name = file.Name;
|
||||
Model.Token = file.Id;
|
||||
}
|
||||
}
|
||||
|
||||
private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = new FileOpenPicker
|
||||
{
|
||||
ViewMode = PickerViewMode.List,
|
||||
SuggestedStartLocation = PickerLocationId.DocumentsLibrary
|
||||
};
|
||||
picker.FileTypeFilter.Add(".kdbx");
|
||||
|
||||
// Application now has read/write access to the picked file
|
||||
var file = await picker.PickSingleFileAsync().AsTask();
|
||||
if (file == null) return;
|
||||
|
||||
// TODO: use service
|
||||
Model.Token = StorageApplicationPermissions.MostRecentlyUsedList.Add(file, file.Path);
|
||||
Model.Path = file.Path;
|
||||
Model.Name = file.Name;
|
||||
Model.SetFileInformation(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user