mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Created Import/Export page (stub)
Changed some dependency properties from Interfaces to implementations Used CanExecute on Commands
This commit is contained in:
35
ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml
Normal file
35
ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml
Normal file
@@ -0,0 +1,35 @@
|
||||
<Page
|
||||
x:Class="ModernKeePass.Views.ImportExportPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Import" Style="{StaticResource SubheaderTextBlockStyle}" />
|
||||
<HyperlinkButton Grid.Column="0" Grid.Row="1" Content="Select file..." Style="{StaticResource MainColorHyperlinkButton}" Click="ImportFileButton_OnClick" />
|
||||
<StackPanel Grid.Column="1" Grid.Row="1" >
|
||||
<TextBlock Text="Format" Style="{StaticResource BodyTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<ComboBox Style="{StaticResource MainColorComboBox}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Grid.Row="1" >
|
||||
<TextBlock Text="Import into..." Style="{StaticResource BodyTextBlockStyle}" Margin="0,0,0,10" />
|
||||
<RadioButton GroupName="ImportDestination" Content="New database" />
|
||||
<RadioButton GroupName="ImportDestination" Content="Currently opened database" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="3" Grid.Row="1" Content="Import" Style="{StaticResource MainColorButton}" />
|
||||
</Grid>
|
||||
</Page>
|
35
ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml.cs
Normal file
35
ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace ModernKeePass.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// The import/export page.
|
||||
/// </summary>
|
||||
public sealed partial class ImportExportPage
|
||||
{
|
||||
public ImportExportPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
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
|
||||
var file = await picker.PickSingleFileAsync();
|
||||
if (file == null) return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user