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,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Windows.Storage.AccessCache;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.UI.Xaml;
|
||||
using ModernKeePass.ViewModels;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace ModernKeePass.Views
|
||||
{
|
||||
@@ -14,28 +7,9 @@ namespace ModernKeePass.Views
|
||||
/// </summary>
|
||||
public sealed partial class NewDatabasePage
|
||||
{
|
||||
private NewVm Model => (NewVm)DataContext;
|
||||
|
||||
public NewDatabasePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void CreateDatabaseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var savePicker = new FileSavePicker
|
||||
{
|
||||
SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
|
||||
SuggestedFileName = "New Database"
|
||||
};
|
||||
savePicker.FileTypeChoices.Add("KeePass 2.x database", new List<string> {".kdbx"});
|
||||
|
||||
var file = await savePicker.PickSaveFileAsync().AsTask();
|
||||
if (file == null) return;
|
||||
|
||||
Model.Token = StorageApplicationPermissions.FutureAccessList.Add(file, file.Name);
|
||||
Model.Name = file.Name;
|
||||
Model.Path = file.Path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user