WIP Import mechanism

This commit is contained in:
BONNEVILLE Geoffroy
2018-09-07 18:16:40 +02:00
parent 549006036b
commit 0da6a5fc60
14 changed files with 141 additions and 52 deletions

View File

@@ -2,6 +2,8 @@
using System.Collections.Generic;
using Windows.Storage.Pickers;
using Windows.UI.Xaml;
using ModernKeePass.Events;
using ModernKeePass.Services;
using ModernKeePass.ViewModels;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
@@ -33,5 +35,25 @@ namespace ModernKeePass.Views
if (file == null) return;
Model.OpenFile(file);
}
private async void ImportFileButton_OnClick(object sender, RoutedEventArgs e)
{
var picker =
new FileOpenPicker
{
ViewMode = PickerViewMode.List,
SuggestedStartLocation = PickerLocationId.DocumentsLibrary
};
picker.FileTypeFilter.Add(".csv");
// Application now has read/write access to the picked file
Model.ImportFile = await picker.PickSingleFileAsync();
}
private void CompositeKeyUserControl_OnValidationChecked(object sender, PasswordEventArgs e)
{
Model.PopulateInitialData(DatabaseService.Instance, new SettingsService());
Frame.Navigate(typeof(GroupDetailPage));
}
}
}