Bug correction when canceling open file dialog

New About page
Main menu pages now have titles
This commit is contained in:
2017-10-16 10:57:39 +02:00
committed by BONNEVILLE Geoffroy
parent 86064af3a2
commit 5497e6fc00
9 changed files with 89 additions and 24 deletions

View File

@@ -133,6 +133,9 @@
<DependentUpon>MainPage.xaml</DependentUpon> <DependentUpon>MainPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Mappings\PwIconToSegoeMapping.cs" /> <Compile Include="Mappings\PwIconToSegoeMapping.cs" />
<Compile Include="Pages\AboutPage.xaml.cs">
<DependentUpon>AboutPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\NewDatabasePage.xaml.cs"> <Compile Include="Pages\NewDatabasePage.xaml.cs">
<DependentUpon>NewDatabasePage.xaml</DependentUpon> <DependentUpon>NewDatabasePage.xaml</DependentUpon>
</Compile> </Compile>
@@ -190,6 +193,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Pages\AboutPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\EntryDetailPage.xaml"> <Page Include="Pages\EntryDetailPage.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>

View File

@@ -0,0 +1,18 @@
<Page
x:Class="ModernKeePass.Pages.AboutPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ModernKeePass.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="0,-20,0,20">About</TextBlock>
<TextBlock Style="{StaticResource BodyTextBlockStyle}">ModernKeePass version 1.4</TextBlock>
<TextBlock Style="{StaticResource BodyTextBlockStyle}">Homepage: https://github.com/wismna/ModernKeePass</TextBlock>
<TextBlock Style="{StaticResource BodyTextBlockStyle}">Credits:</TextBlock>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="20,0,0,0">Dominik Reichl for the KeePass application and file format</TextBlock>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="20,0,0,0">ArtjomP for his PCL adapatation of the KeePass Library</TextBlock>
</StackPanel>
</Page>

View File

@@ -0,0 +1,30 @@
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 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
namespace ModernKeePass.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class AboutPage : Page
{
public AboutPage()
{
this.InitializeComponent();
}
}
}

View File

@@ -16,6 +16,7 @@
</Page.DataContext> </Page.DataContext>
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="0,-20,0,20">New</TextBlock>
<HyperlinkButton Content="Create new..." Click="ButtonBase_OnClick" /> <HyperlinkButton Content="Create new..." Click="ButtonBase_OnClick" />
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30">Create a new password database to the location of your chosing.</TextBlock> <TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30">Create a new password database to the location of your chosing.</TextBlock>
<TextBlock TextWrapping="Wrap" Text="{Binding Name}" Height="auto" Width="auto" FontSize="16" Margin="10,7,0,6" /> <TextBlock TextWrapping="Wrap" Text="{Binding Name}" Height="auto" Width="auto" FontSize="16" Margin="10,7,0,6" />

View File

@@ -16,6 +16,7 @@
</Page.DataContext> </Page.DataContext>
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="0,-20,0,20">Open</TextBlock>
<HyperlinkButton Content="Browse files..." Click="ButtonBase_OnClick" /> <HyperlinkButton Content="Browse files..." Click="ButtonBase_OnClick" />
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30">Open an existing password database from your PC.</TextBlock> <TextBlock Style="{StaticResource BodyTextBlockStyle}" Margin="15,0,0,30">Open an existing password database from your PC.</TextBlock>
<HyperlinkButton Content="From Url..." IsEnabled="False" /> <HyperlinkButton Content="From Url..." IsEnabled="False" />

View File

@@ -41,7 +41,9 @@ namespace ModernKeePass.Pages
picker.FileTypeFilter.Add(".kdbx"); picker.FileTypeFilter.Add(".kdbx");
// Application now has read/write access to the picked file // Application now has read/write access to the picked file
Model.OpenFile(await picker.PickSingleFileAsync()); var file = await picker.PickSingleFileAsync();
if (file == null) return;
Model.OpenFile(file);
} }
private void PasswordUserControl_PasswordChecked(object sender, PasswordEventArgs e) private void PasswordUserControl_PasswordChecked(object sender, PasswordEventArgs e)

View File

@@ -15,24 +15,26 @@
<Page.DataContext> <Page.DataContext>
<viewModels:RecentVm/> <viewModels:RecentVm/>
</Page.DataContext> </Page.DataContext>
<ListView <StackPanel Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
Background="{StaticResource ApplicationPageBackgroundThemeBrush}" <TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="0,-20,0,20">Recent</TextBlock>
ItemsSource="{Binding Source={StaticResource RecentItemsSource}}" <ListView
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"> ItemsSource="{Binding Source={StaticResource RecentItemsSource}}"
<ListView.ItemTemplate> SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
<DataTemplate> <ListView.ItemTemplate>
<StackPanel Margin="10,0,10,0"> <DataTemplate>
<TextBlock Text="{Binding Name}" Width="350" Padding="5,0,0,0" /> <StackPanel Margin="10,0,10,0">
<TextBlock Text="{Binding Path}" Width="350" Padding="5,0,0,0" FontSize="10" /> <TextBlock Text="{Binding Name}" Width="350" Padding="5,0,0,0" />
<local:OpenDatabaseUserControl Margin="0,10,0,0" Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" ValidationChecking="OpenDatabaseUserControl_OnValidationChecking" ValidationChecked="PasswordUserControl_PasswordChecked" /> <TextBlock Text="{Binding Path}" Width="350" Padding="5,0,0,0" FontSize="10" />
</StackPanel> <local:OpenDatabaseUserControl Margin="0,10,0,0" Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" ValidationChecking="OpenDatabaseUserControl_OnValidationChecking" ValidationChecked="PasswordUserControl_PasswordChecked" />
</DataTemplate> </StackPanel>
</ListView.ItemTemplate> </DataTemplate>
<ListView.ItemContainerStyle> </ListView.ItemTemplate>
<Style TargetType="ListViewItem"> <ListView.ItemContainerStyle>
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Style TargetType="ListViewItem">
<Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style> <Setter Property="VerticalContentAlignment" Value="Stretch" />
</ListView.ItemContainerStyle> </Style>
</ListView> </ListView.ItemContainerStyle>
</ListView>
</StackPanel>
</Page> </Page>

View File

@@ -24,6 +24,6 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.0.0")] [assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: ComVisible(false)] [assembly: ComVisible(false)]

View File

@@ -66,6 +66,10 @@ namespace ModernKeePass.ViewModels
new MainMenuItemVm { new MainMenuItemVm {
Title = "Recent" , PageType = typeof(RecentDatabasesPage), Destination = destinationFrame, Parameter = referenceFrame, SymbolIcon = Symbol.Copy, Title = "Recent" , PageType = typeof(RecentDatabasesPage), Destination = destinationFrame, Parameter = referenceFrame, SymbolIcon = Symbol.Copy,
IsSelected = (app.Database == null || app.Database.Status == DatabaseHelper.DatabaseStatus.Closed) && mru.Entries.Count > 0, IsEnabled = mru.Entries.Count > 0 IsSelected = (app.Database == null || app.Database.Status == DatabaseHelper.DatabaseStatus.Closed) && mru.Entries.Count > 0, IsEnabled = mru.Entries.Count > 0
},
new MainMenuItemVm
{
Title = "About" , PageType = typeof(AboutPage), Destination = destinationFrame, SymbolIcon = Symbol.Help
} }
}; };
// Auto-select the Recent Items menu item if the conditions are met // Auto-select the Recent Items menu item if the conditions are met