WIP open a database

This commit is contained in:
2017-09-11 18:25:00 +02:00
parent 766e33c6ab
commit 4487f0343f
286 changed files with 176971 additions and 38 deletions

View File

@@ -1,17 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using ModernKeePass.Pages;
using System;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
@@ -26,5 +16,26 @@ namespace ModernKeePass
{
this.InitializeComponent();
}
private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
var picker = new Windows.Storage.Pickers.FileOpenPicker();
picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.List;
picker.SuggestedStartLocation =
Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;
picker.FileTypeFilter.Add(".kdbx");
var file = await picker.PickSingleFileAsync();
if (file != null)
{
// Application now has read/write access to the picked file
textBlock.Text = "Opened database: " + file.Name;
Frame.Navigate(typeof(DatabaseViewPage), file);
}
else
{
textBlock.Text = "Operation cancelled.";
}
}
}
}