mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Implemented Donate page with wirking (?) in app purchases
Moved Pages to Views
This commit is contained in:
@@ -9,6 +9,7 @@ using Windows.UI.Xaml.Navigation;
|
|||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Exceptions;
|
using ModernKeePass.Exceptions;
|
||||||
using ModernKeePass.Services;
|
using ModernKeePass.Services;
|
||||||
|
using ModernKeePass.Views;
|
||||||
|
|
||||||
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
|
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ namespace ModernKeePass
|
|||||||
// When the navigation stack isn't restored navigate to the first page,
|
// When the navigation stack isn't restored navigate to the first page,
|
||||||
// configuring the new page by passing required information as a navigation
|
// configuring the new page by passing required information as a navigation
|
||||||
// parameter
|
// parameter
|
||||||
rootFrame.Navigate(typeof(Pages.MainPage), lauchActivatedEventArgs.Arguments);
|
rootFrame.Navigate(typeof(MainPage), lauchActivatedEventArgs.Arguments);
|
||||||
}
|
}
|
||||||
/*else
|
/*else
|
||||||
{
|
{
|
||||||
@@ -158,7 +159,7 @@ namespace ModernKeePass
|
|||||||
base.OnFileActivated(args);
|
base.OnFileActivated(args);
|
||||||
var rootFrame = new Frame();
|
var rootFrame = new Frame();
|
||||||
Database.DatabaseFile = args.Files[0] as StorageFile;
|
Database.DatabaseFile = args.Files[0] as StorageFile;
|
||||||
rootFrame.Navigate(typeof(Pages.MainPage), args);
|
rootFrame.Navigate(typeof(MainPage), args);
|
||||||
Window.Current.Content = rootFrame;
|
Window.Current.Content = rootFrame;
|
||||||
Window.Current.Activate();
|
Window.Current.Activate();
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Windows.Storage.Pickers;
|
using Windows.Storage.Pickers;
|
||||||
using Windows.UI.Popups;
|
using Windows.UI.Popups;
|
||||||
|
using Windows.UI.Xaml.Media.Animation;
|
||||||
using ModernKeePass.Exceptions;
|
using ModernKeePass.Exceptions;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
|
|
||||||
@@ -12,17 +13,10 @@ namespace ModernKeePass.Common
|
|||||||
public static async void ShowActionDialog(string title, string contentText, string actionButtonText, string cancelButtonText, UICommandInvokedHandler action)
|
public static async void ShowActionDialog(string title, string contentText, string actionButtonText, string cancelButtonText, UICommandInvokedHandler action)
|
||||||
{
|
{
|
||||||
// Create the message dialog and set its content
|
// Create the message dialog and set its content
|
||||||
var messageDialog = new MessageDialog(contentText, title);
|
var messageDialog = CreateBasicDialog(title, contentText, cancelButtonText);
|
||||||
|
|
||||||
// Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
|
// Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
|
||||||
messageDialog.Commands.Add(new UICommand(actionButtonText, action));
|
messageDialog.Commands.Add(new UICommand(actionButtonText, action));
|
||||||
messageDialog.Commands.Add(new UICommand(cancelButtonText));
|
|
||||||
|
|
||||||
// Set the command that will be invoked by default
|
|
||||||
messageDialog.DefaultCommandIndex = 1;
|
|
||||||
|
|
||||||
// Set the command to be invoked when escape is pressed
|
|
||||||
messageDialog.CancelCommandIndex = 1;
|
|
||||||
|
|
||||||
// Show the message dialog
|
// Show the message dialog
|
||||||
await messageDialog.ShowAsync();
|
await messageDialog.ShowAsync();
|
||||||
@@ -48,13 +42,35 @@ namespace ModernKeePass.Common
|
|||||||
{
|
{
|
||||||
if (exception == null) return;
|
if (exception == null) return;
|
||||||
// Create the message dialog and set its content
|
// Create the message dialog and set its content
|
||||||
var messageDialog = new MessageDialog(exception.Message, "Error occured");
|
var messageDialog = CreateBasicDialog("Error occured", exception.Message, "OK");
|
||||||
|
|
||||||
// Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
|
|
||||||
messageDialog.Commands.Add(new UICommand("OK"));
|
|
||||||
|
|
||||||
// Show the message dialog
|
// Show the message dialog
|
||||||
await messageDialog.ShowAsync();
|
await messageDialog.ShowAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async void ShowNotificationDialog(string title, string message)
|
||||||
|
{
|
||||||
|
var dialog = CreateBasicDialog(title, message, "OK");
|
||||||
|
|
||||||
|
// Show the message dialog
|
||||||
|
await dialog.ShowAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MessageDialog CreateBasicDialog(string title, string message, string dismissActionText)
|
||||||
|
{
|
||||||
|
// Create the message dialog and set its content
|
||||||
|
var messageDialog = new MessageDialog(message, title);
|
||||||
|
|
||||||
|
// Add commands and set their callbacks;
|
||||||
|
messageDialog.Commands.Add(new UICommand(dismissActionText));
|
||||||
|
|
||||||
|
// Set the command that will be invoked by default
|
||||||
|
messageDialog.DefaultCommandIndex = 1;
|
||||||
|
|
||||||
|
// Set the command to be invoked when escape is pressed
|
||||||
|
messageDialog.CancelCommandIndex = 1;
|
||||||
|
|
||||||
|
return messageDialog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Windows.ApplicationModel.Store;
|
using Windows.ApplicationModel.Store;
|
||||||
|
|
||||||
namespace ModernKeePass.Interfaces
|
namespace ModernKeePass.Interfaces
|
||||||
@@ -6,5 +7,6 @@ namespace ModernKeePass.Interfaces
|
|||||||
public interface ILicenseService
|
public interface ILicenseService
|
||||||
{
|
{
|
||||||
IReadOnlyDictionary<string, ProductListing> Products { get; }
|
IReadOnlyDictionary<string, ProductListing> Products { get; }
|
||||||
|
Task<int> Purchase(string addOn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -117,7 +117,8 @@
|
|||||||
<Compile Include="Interfaces\IRecent.cs" />
|
<Compile Include="Interfaces\IRecent.cs" />
|
||||||
<Compile Include="Interfaces\IRecentItem.cs" />
|
<Compile Include="Interfaces\IRecentItem.cs" />
|
||||||
<Compile Include="Interfaces\IResource.cs" />
|
<Compile Include="Interfaces\IResource.cs" />
|
||||||
<Compile Include="Pages\MainPageFrames\DonatePage.xaml.cs">
|
<Compile Include="ViewModels\DonateVm.cs" />
|
||||||
|
<Compile Include="Views\MainPageFrames\DonatePage.xaml.cs">
|
||||||
<DependentUpon>DonatePage.xaml</DependentUpon>
|
<DependentUpon>DonatePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Services\DatabaseService.cs" />
|
<Compile Include="Services\DatabaseService.cs" />
|
||||||
@@ -141,22 +142,22 @@
|
|||||||
<Compile Include="Interfaces\IDatabase.cs" />
|
<Compile Include="Interfaces\IDatabase.cs" />
|
||||||
<Compile Include="Interfaces\IHasSelectableObject.cs" />
|
<Compile Include="Interfaces\IHasSelectableObject.cs" />
|
||||||
<Compile Include="Interfaces\ISelectableModel.cs" />
|
<Compile Include="Interfaces\ISelectableModel.cs" />
|
||||||
<Compile Include="Pages\BasePages\LayoutAwarePageBase.cs" />
|
<Compile Include="Views\BasePages\LayoutAwarePageBase.cs" />
|
||||||
<Compile Include="Pages\SettingsPageFrames\SettingsDatabasePage.xaml.cs">
|
<Compile Include="Views\SettingsPageFrames\SettingsDatabasePage.xaml.cs">
|
||||||
<DependentUpon>SettingsDatabasePage.xaml</DependentUpon>
|
<DependentUpon>SettingsDatabasePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SettingsPageFrames\SettingsNewDatabasePage.xaml.cs">
|
<Compile Include="Views\SettingsPageFrames\SettingsNewDatabasePage.xaml.cs">
|
||||||
<DependentUpon>SettingsNewDatabasePage.xaml</DependentUpon>
|
<DependentUpon>SettingsNewDatabasePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SettingsPageFrames\SettingsSecurityPage.xaml.cs">
|
<Compile Include="Views\SettingsPageFrames\SettingsSecurityPage.xaml.cs">
|
||||||
<DependentUpon>SettingsSecurityPage.xaml</DependentUpon>
|
<DependentUpon>SettingsSecurityPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SettingsPageFrames\SettingsWelcomePage.xaml.cs">
|
<Compile Include="Views\SettingsPageFrames\SettingsWelcomePage.xaml.cs">
|
||||||
<DependentUpon>SettingsWelcomePage.xaml</DependentUpon>
|
<DependentUpon>SettingsWelcomePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="TemplateSelectors\FirstItemDataTemplateSelector.cs" />
|
<Compile Include="TemplateSelectors\FirstItemDataTemplateSelector.cs" />
|
||||||
<Compile Include="Controls\ListViewWithDisable.cs" />
|
<Compile Include="Controls\ListViewWithDisable.cs" />
|
||||||
<Compile Include="Controls\CompositeKeyUserControl.xaml.cs">
|
<Compile Include="Views\UserControls\CompositeKeyUserControl.xaml.cs">
|
||||||
<DependentUpon>CompositeKeyUserControl.xaml</DependentUpon>
|
<DependentUpon>CompositeKeyUserControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Controls\TextBoxWithButton.cs" />
|
<Compile Include="Controls\TextBoxWithButton.cs" />
|
||||||
@@ -171,20 +172,20 @@
|
|||||||
<Compile Include="Events\PasswordEventArgs.cs" />
|
<Compile Include="Events\PasswordEventArgs.cs" />
|
||||||
<Compile Include="Interfaces\IIsEnabled.cs" />
|
<Compile Include="Interfaces\IIsEnabled.cs" />
|
||||||
<Compile Include="Interfaces\IPwEntity.cs" />
|
<Compile Include="Interfaces\IPwEntity.cs" />
|
||||||
<Compile Include="Pages\MainPage.xaml.cs">
|
<Compile Include="Views\MainPage.xaml.cs">
|
||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Mappings\PwIconToSegoeMapping.cs" />
|
<Compile Include="Mappings\PwIconToSegoeMapping.cs" />
|
||||||
<Compile Include="Pages\MainPageFrames\AboutPage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\AboutPage.xaml.cs">
|
||||||
<DependentUpon>AboutPage.xaml</DependentUpon>
|
<DependentUpon>AboutPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MainPageFrames\NewDatabasePage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\NewDatabasePage.xaml.cs">
|
||||||
<DependentUpon>NewDatabasePage.xaml</DependentUpon>
|
<DependentUpon>NewDatabasePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\SettingsPage.xaml.cs">
|
<Compile Include="Views\SettingsPage.xaml.cs">
|
||||||
<DependentUpon>SettingsPage.xaml</DependentUpon>
|
<DependentUpon>SettingsPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MainPageFrames\WelcomePage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\WelcomePage.xaml.cs">
|
||||||
<DependentUpon>WelcomePage.xaml</DependentUpon>
|
<DependentUpon>WelcomePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ViewModels\AboutVm.cs" />
|
<Compile Include="ViewModels\AboutVm.cs" />
|
||||||
@@ -192,19 +193,19 @@
|
|||||||
<Compile Include="ViewModels\Items\ListMenuItemVm.cs" />
|
<Compile Include="ViewModels\Items\ListMenuItemVm.cs" />
|
||||||
<Compile Include="ViewModels\Items\MainMenuItemVm.cs" />
|
<Compile Include="ViewModels\Items\MainMenuItemVm.cs" />
|
||||||
<Compile Include="ViewModels\Items\RecentItemVm.cs" />
|
<Compile Include="ViewModels\Items\RecentItemVm.cs" />
|
||||||
<Compile Include="Pages\EntryDetailPage.xaml.cs">
|
<Compile Include="Views\EntryDetailPage.xaml.cs">
|
||||||
<DependentUpon>EntryDetailPage.xaml</DependentUpon>
|
<DependentUpon>EntryDetailPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\GroupDetailPage.xaml.cs">
|
<Compile Include="Views\GroupDetailPage.xaml.cs">
|
||||||
<DependentUpon>GroupDetailPage.xaml</DependentUpon>
|
<DependentUpon>GroupDetailPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MainPageFrames\OpenDatabasePage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\OpenDatabasePage.xaml.cs">
|
||||||
<DependentUpon>OpenDatabasePage.xaml</DependentUpon>
|
<DependentUpon>OpenDatabasePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MainPageFrames\RecentDatabasesPage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\RecentDatabasesPage.xaml.cs">
|
||||||
<DependentUpon>RecentDatabasesPage.xaml</DependentUpon>
|
<DependentUpon>RecentDatabasesPage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Pages\MainPageFrames\SaveDatabasePage.xaml.cs">
|
<Compile Include="Views\MainPageFrames\SaveDatabasePage.xaml.cs">
|
||||||
<DependentUpon>SaveDatabasePage.xaml</DependentUpon>
|
<DependentUpon>SaveDatabasePage.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
@@ -239,67 +240,67 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="Controls\CompositeKeyUserControl.xaml">
|
<Page Include="Views\UserControls\CompositeKeyUserControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPage.xaml">
|
<Page Include="Views\MainPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\AboutPage.xaml">
|
<Page Include="Views\MainPageFrames\AboutPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\EntryDetailPage.xaml">
|
<Page Include="Views\EntryDetailPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\GroupDetailPage.xaml">
|
<Page Include="Views\GroupDetailPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\DonatePage.xaml">
|
<Page Include="Views\MainPageFrames\DonatePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\NewDatabasePage.xaml">
|
<Page Include="Views\MainPageFrames\NewDatabasePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\OpenDatabasePage.xaml">
|
<Page Include="Views\MainPageFrames\OpenDatabasePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\RecentDatabasesPage.xaml">
|
<Page Include="Views\MainPageFrames\RecentDatabasesPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\SaveDatabasePage.xaml">
|
<Page Include="Views\MainPageFrames\SaveDatabasePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPage.xaml">
|
<Page Include="Views\SettingsPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\MainPageFrames\WelcomePage.xaml">
|
<Page Include="Views\MainPageFrames\WelcomePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPageFrames\SettingsDatabasePage.xaml">
|
<Page Include="Views\SettingsPageFrames\SettingsDatabasePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPageFrames\SettingsNewDatabasePage.xaml">
|
<Page Include="Views\SettingsPageFrames\SettingsNewDatabasePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPageFrames\SettingsSecurityPage.xaml">
|
<Page Include="Views\SettingsPageFrames\SettingsSecurityPage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Pages\SettingsPageFrames\SettingsWelcomePage.xaml">
|
<Page Include="Views\SettingsPageFrames\SettingsWelcomePage.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
<Page
|
|
||||||
x:Class="ModernKeePass.Pages.MainPageFrames.DonatePage"
|
|
||||||
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">
|
|
||||||
|
|
||||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
||||||
<TextBlock x:Uid="DonateDesc" />
|
|
||||||
<RadioButton GroupName="DonateOptions" Content="1" />
|
|
||||||
<RadioButton GroupName="DonateOptions" Content="5" />
|
|
||||||
<RadioButton GroupName="DonateOptions" Content="10" />
|
|
||||||
<RadioButton GroupName="DonateOptions" Content="20" />
|
|
||||||
<Button x:Uid="DonateButton" />
|
|
||||||
</StackPanel>
|
|
||||||
</Page>
|
|
@@ -1,30 +0,0 @@
|
|||||||
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.MainPageFrames
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class DonatePage : Page
|
|
||||||
{
|
|
||||||
public DonatePage()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,30 +0,0 @@
|
|||||||
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 WelcomePage : Page
|
|
||||||
{
|
|
||||||
public WelcomePage()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,30 +0,0 @@
|
|||||||
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.SettingsPageFrames
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
||||||
/// </summary>
|
|
||||||
public sealed partial class SettingsWelcomePage : Page
|
|
||||||
{
|
|
||||||
public SettingsWelcomePage()
|
|
||||||
{
|
|
||||||
this.InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -35,8 +35,12 @@ namespace ModernKeePass.Services
|
|||||||
// Comment the following line in the release version of your app.
|
// Comment the following line in the release version of your app.
|
||||||
//_licenseInformation = CurrentAppSimulator.LicenseInformation;
|
//_licenseInformation = CurrentAppSimulator.LicenseInformation;
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
try
|
||||||
|
{
|
||||||
var proxyFile = Package.Current.InstalledLocation.GetFileAsync("data\\WindowsStoreProxy.xml").GetAwaiter().GetResult();
|
var proxyFile = Package.Current.InstalledLocation.GetFileAsync("data\\WindowsStoreProxy.xml").GetAwaiter().GetResult();
|
||||||
CurrentAppSimulator.ReloadSimulatorAsync(proxyFile).GetAwaiter().GetResult();
|
CurrentAppSimulator.ReloadSimulatorAsync(proxyFile).GetAwaiter().GetResult();
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
var listing = CurrentAppSimulator.LoadListingInformationAsync().GetAwaiter().GetResult();
|
var listing = CurrentAppSimulator.LoadListingInformationAsync().GetAwaiter().GetResult();
|
||||||
#else
|
#else
|
||||||
var listing = CurrentApp.LoadListingInformationAsync().GetAwaiter().GetResult();
|
var listing = CurrentApp.LoadListingInformationAsync().GetAwaiter().GetResult();
|
||||||
@@ -44,7 +48,7 @@ namespace ModernKeePass.Services
|
|||||||
Products = listing.ProductListings;
|
Products = listing.ProductListings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PurchaseResult> Purchase(string addOn)
|
public async Task<int> Purchase(string addOn)
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var purchaseResults = await CurrentAppSimulator.RequestProductPurchaseAsync(addOn);
|
var purchaseResults = await CurrentAppSimulator.RequestProductPurchaseAsync(addOn);
|
||||||
@@ -55,7 +59,7 @@ namespace ModernKeePass.Services
|
|||||||
{
|
{
|
||||||
case ProductPurchaseStatus.Succeeded:
|
case ProductPurchaseStatus.Succeeded:
|
||||||
GrantFeatureLocally(purchaseResults.TransactionId);
|
GrantFeatureLocally(purchaseResults.TransactionId);
|
||||||
return await ReportFulfillmentAsync(purchaseResults.TransactionId, addOn);
|
return (int) await ReportFulfillmentAsync(purchaseResults.TransactionId, addOn);
|
||||||
case ProductPurchaseStatus.NotFulfilled:
|
case ProductPurchaseStatus.NotFulfilled:
|
||||||
// The purchase failed because we haven't confirmed fulfillment of a previous purchase.
|
// The purchase failed because we haven't confirmed fulfillment of a previous purchase.
|
||||||
// Fulfill it now.
|
// Fulfill it now.
|
||||||
@@ -63,11 +67,11 @@ namespace ModernKeePass.Services
|
|||||||
{
|
{
|
||||||
GrantFeatureLocally(purchaseResults.TransactionId);
|
GrantFeatureLocally(purchaseResults.TransactionId);
|
||||||
}
|
}
|
||||||
return await ReportFulfillmentAsync(purchaseResults.TransactionId, addOn);
|
return (int) await ReportFulfillmentAsync(purchaseResults.TransactionId, addOn);
|
||||||
case ProductPurchaseStatus.NotPurchased:
|
case ProductPurchaseStatus.NotPurchased:
|
||||||
return PurchaseResult.NotPurchased;
|
return (int) PurchaseResult.NotPurchased;
|
||||||
case ProductPurchaseStatus.AlreadyPurchased:
|
case ProductPurchaseStatus.AlreadyPurchased:
|
||||||
return PurchaseResult.AlreadyPurchased;
|
return (int) PurchaseResult.AlreadyPurchased;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
@@ -75,11 +79,10 @@ namespace ModernKeePass.Services
|
|||||||
|
|
||||||
private async Task<PurchaseResult> ReportFulfillmentAsync(Guid transactionId, string productName)
|
private async Task<PurchaseResult> ReportFulfillmentAsync(Guid transactionId, string productName)
|
||||||
{
|
{
|
||||||
FulfillmentResult result;
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
result = await CurrentAppSimulator.ReportConsumableFulfillmentAsync(productName, transactionId);
|
var result = await CurrentAppSimulator.ReportConsumableFulfillmentAsync(productName, transactionId);
|
||||||
#else
|
#else
|
||||||
result = await CurrentApp.ReportConsumableFulfillmentAsync(productName, transactionId);
|
var result = await CurrentApp.ReportConsumableFulfillmentAsync(productName, transactionId);
|
||||||
#endif
|
#endif
|
||||||
return (PurchaseResult) result;
|
return (PurchaseResult) result;
|
||||||
}
|
}
|
||||||
|
@@ -141,6 +141,48 @@
|
|||||||
<data name="CompositeKeyUpdated" xml:space="preserve">
|
<data name="CompositeKeyUpdated" xml:space="preserve">
|
||||||
<value>Database composite key updated.</value>
|
<value>Database composite key updated.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="DonateAlreadyPurchasedMessage" xml:space="preserve">
|
||||||
|
<value>Your product has already been purchased.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateAlreadyPurchasedTitle" xml:space="preserve">
|
||||||
|
<value>Purchase</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNothingToFulfillMessage" xml:space="preserve">
|
||||||
|
<value>No purchased product to fulfill</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNothingToFulfillTitle" xml:space="preserve">
|
||||||
|
<value>Fulfillment</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNotPurchasedMessage" xml:space="preserve">
|
||||||
|
<value>The purchase failed because we haven't confirmed fulfillment of a previous purchase.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNotPurchasedTitle" xml:space="preserve">
|
||||||
|
<value>Purchase</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchasePendingMessage" xml:space="preserve">
|
||||||
|
<value>The purchase is pending so we cannot fulfill the product.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchasePendingTitle" xml:space="preserve">
|
||||||
|
<value>Purchase</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchaseRevertedMessage" xml:space="preserve">
|
||||||
|
<value>Your purchase has been reverted.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchaseRevertedTitle" xml:space="preserve">
|
||||||
|
<value>Purchase</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateServerErrorMessage" xml:space="preserve">
|
||||||
|
<value>Impossible to contact the Windows Store, there was an error when fulfilling.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateServerErrorTitle" xml:space="preserve">
|
||||||
|
<value>Error</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateSucceededMessage" xml:space="preserve">
|
||||||
|
<value>Your donation was successful.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateSucceededTitle" xml:space="preserve">
|
||||||
|
<value>Thank you!</value>
|
||||||
|
</data>
|
||||||
<data name="EntityDeleteActionButton" xml:space="preserve">
|
<data name="EntityDeleteActionButton" xml:space="preserve">
|
||||||
<value>Delete</value>
|
<value>Delete</value>
|
||||||
</data>
|
</data>
|
||||||
|
@@ -141,6 +141,48 @@
|
|||||||
<data name="CompositeKeyUpdated" xml:space="preserve">
|
<data name="CompositeKeyUpdated" xml:space="preserve">
|
||||||
<value>Clé composite de la base de données mise à jour.</value>
|
<value>Clé composite de la base de données mise à jour.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="DonateAlreadyPurchasedMessage" xml:space="preserve">
|
||||||
|
<value>Vous avez déjà acheté ce produit.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateAlreadyPurchasedTitle" xml:space="preserve">
|
||||||
|
<value>Achat</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNothingToFulfillMessage" xml:space="preserve">
|
||||||
|
<value>Il n'y a aucun produit acheté à valider.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNothingToFulfillTitle" xml:space="preserve">
|
||||||
|
<value>Validation</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNotPurchasedMessage" xml:space="preserve">
|
||||||
|
<value>L'achat a échoué parce que nous n'avons pas pu valider un achat précédent.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateNotPurchasedTitle" xml:space="preserve">
|
||||||
|
<value>Achat</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchasePendingMessage" xml:space="preserve">
|
||||||
|
<value>Un achat est en cours donc nous ne pouvons le valider.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchasePendingTitle" xml:space="preserve">
|
||||||
|
<value>Achat</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchaseRevertedMessage" xml:space="preserve">
|
||||||
|
<value>Votre achat a été annulé.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonatePurchaseRevertedTitle" xml:space="preserve">
|
||||||
|
<value>Achat</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateServerErrorMessage" xml:space="preserve">
|
||||||
|
<value>Impossible de contacter le Windows Store, l'achat n'a pas été réalisé.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateServerErrorTitle" xml:space="preserve">
|
||||||
|
<value>Erreur</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateSucceededMessage" xml:space="preserve">
|
||||||
|
<value>Votre don a été enregistré.</value>
|
||||||
|
</data>
|
||||||
|
<data name="DonateSucceededTitle" xml:space="preserve">
|
||||||
|
<value>Merci!</value>
|
||||||
|
</data>
|
||||||
<data name="EntityDeleteActionButton" xml:space="preserve">
|
<data name="EntityDeleteActionButton" xml:space="preserve">
|
||||||
<value>Supprimer</value>
|
<value>Supprimer</value>
|
||||||
</data>
|
</data>
|
||||||
|
38
ModernKeePass/ViewModels/DonateVm.cs
Normal file
38
ModernKeePass/ViewModels/DonateVm.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.ApplicationModel.Store;
|
||||||
|
using ModernKeePass.Common;
|
||||||
|
using ModernKeePass.Interfaces;
|
||||||
|
using ModernKeePass.Services;
|
||||||
|
|
||||||
|
namespace ModernKeePass.ViewModels
|
||||||
|
{
|
||||||
|
public class DonateVm: NotifyPropertyChangedBase
|
||||||
|
{
|
||||||
|
public ObservableCollection<ProductListing> Donations { get; }
|
||||||
|
|
||||||
|
public ProductListing SelectedItem
|
||||||
|
{
|
||||||
|
get { return _selectedItem; }
|
||||||
|
set { SetProperty(ref _selectedItem, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly ILicenseService _license;
|
||||||
|
private ProductListing _selectedItem;
|
||||||
|
|
||||||
|
public DonateVm() : this (new LicenseService()) { }
|
||||||
|
|
||||||
|
public DonateVm(ILicenseService license)
|
||||||
|
{
|
||||||
|
_license = license;
|
||||||
|
Donations = new ObservableCollection<ProductListing>(_license.Products.Values.OrderBy(p => /*decimal.Parse(*/p.FormattedPrice/*, NumberStyles.Currency | NumberStyles.AllowDecimalPoint)*/));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<int> Purchase()
|
||||||
|
{
|
||||||
|
return await _license.Purchase(SelectedItem.ProductId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -5,8 +5,8 @@ using Windows.UI.Xaml;
|
|||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
using ModernKeePass.Pages;
|
|
||||||
using ModernKeePass.Services;
|
using ModernKeePass.Services;
|
||||||
|
using ModernKeePass.Views;
|
||||||
|
|
||||||
namespace ModernKeePass.ViewModels
|
namespace ModernKeePass.ViewModels
|
||||||
{
|
{
|
||||||
@@ -107,6 +107,13 @@ namespace ModernKeePass.ViewModels
|
|||||||
PageType = typeof(AboutPage),
|
PageType = typeof(AboutPage),
|
||||||
Destination = destinationFrame,
|
Destination = destinationFrame,
|
||||||
SymbolIcon = Symbol.Help
|
SymbolIcon = Symbol.Help
|
||||||
|
},
|
||||||
|
new MainMenuItemVm
|
||||||
|
{
|
||||||
|
Title = resource.GetResourceValue("MainMenuItemDonate"),
|
||||||
|
PageType = typeof(DonatePage),
|
||||||
|
Destination = destinationFrame,
|
||||||
|
SymbolIcon = Symbol.Shop
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Auto-select the Recent Items menu item if the conditions are met
|
// Auto-select the Recent Items menu item if the conditions are met
|
||||||
|
@@ -4,8 +4,7 @@ using Windows.UI.Xaml;
|
|||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
using ModernKeePass.Pages;
|
using ModernKeePass.Views;
|
||||||
using ModernKeePass.Pages.SettingsPageFrames;
|
|
||||||
using ModernKeePass.Services;
|
using ModernKeePass.Services;
|
||||||
|
|
||||||
namespace ModernKeePass.ViewModels
|
namespace ModernKeePass.ViewModels
|
||||||
|
@@ -6,7 +6,7 @@ using Windows.UI.Xaml.Navigation;
|
|||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
|
|
||||||
namespace ModernKeePass.Pages.BasePages
|
namespace ModernKeePass.Views.BasePages
|
||||||
{
|
{
|
||||||
public class LayoutAwarePageBase: Page
|
public class LayoutAwarePageBase: Page
|
||||||
{
|
{
|
@@ -10,7 +10,7 @@
|
|||||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||||
xmlns:actions="using:ModernKeePass.Actions"
|
xmlns:actions="using:ModernKeePass.Actions"
|
||||||
x:Name="PageRoot"
|
x:Name="PageRoot"
|
||||||
x:Class="ModernKeePass.Pages.EntryDetailPage"
|
x:Class="ModernKeePass.Views.EntryDetailPage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
@@ -380,7 +380,7 @@
|
|||||||
<AppBarButton Icon="Home" x:Uid="AppBarHome">
|
<AppBarButton Icon="Home" x:Uid="AppBarHome">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.MainPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.MainPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
@@ -395,7 +395,7 @@
|
|||||||
<AppBarButton Icon="Setting" x:Uid="AppBarSettings">
|
<AppBarButton Icon="Setting" x:Uid="AppBarSettings">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.SettingsPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.SettingsPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
@@ -8,7 +8,7 @@ using ModernKeePass.ViewModels;
|
|||||||
|
|
||||||
// Pour en savoir plus sur le modèle d'élément Page Détail de l'élément, consultez la page http://go.microsoft.com/fwlink/?LinkId=234232
|
// Pour en savoir plus sur le modèle d'élément Page Détail de l'élément, consultez la page http://go.microsoft.com/fwlink/?LinkId=234232
|
||||||
|
|
||||||
namespace ModernKeePass.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Page affichant les détails d'un élément au sein d'un groupe, offrant la possibilité de
|
/// Page affichant les détails d'un élément au sein d'un groupe, offrant la possibilité de
|
@@ -11,7 +11,7 @@
|
|||||||
xmlns:controls="using:ModernKeePass.Controls"
|
xmlns:controls="using:ModernKeePass.Controls"
|
||||||
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
xmlns:templateSelectors="using:ModernKeePass.TemplateSelectors"
|
||||||
x:Name="PageRoot"
|
x:Name="PageRoot"
|
||||||
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
x:Class="ModernKeePass.Views.GroupDetailPage"
|
||||||
mc:Ignorable="d" >
|
mc:Ignorable="d" >
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<AppBarButton Icon="Home" x:Uid="AppBarHome">
|
<AppBarButton Icon="Home" x:Uid="AppBarHome">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.MainPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.MainPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<AppBarButton Icon="Setting" x:Uid="AppBarSettings">
|
<AppBarButton Icon="Setting" x:Uid="AppBarSettings">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.SettingsPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.SettingsPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
@@ -10,7 +10,7 @@ using ModernKeePass.ViewModels;
|
|||||||
|
|
||||||
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
||||||
|
|
||||||
namespace ModernKeePass.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A page that displays an overview of a single group, including a preview of the items
|
/// A page that displays an overview of a single group, including a preview of the items
|
@@ -5,8 +5,8 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
xmlns:controls="using:ModernKeePass.Controls"
|
xmlns:controls="using:ModernKeePass.Controls"
|
||||||
xmlns:basePages="using:ModernKeePass.Pages.BasePages"
|
xmlns:basePages="using:ModernKeePass.Views.BasePages"
|
||||||
x:Class="ModernKeePass.Pages.MainPage"
|
x:Class="ModernKeePass.Views.MainPage"
|
||||||
x:Name="PageRoot"
|
x:Name="PageRoot"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
@@ -4,7 +4,7 @@ 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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
@@ -4,7 +4,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
x:Class="ModernKeePass.Pages.AboutPage"
|
x:Class="ModernKeePass.Views.AboutPage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Page.DataContext>
|
<Page.DataContext>
|
@@ -1,6 +1,6 @@
|
|||||||
// 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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
30
ModernKeePass/Views/MainPageFrames/DonatePage.xaml
Normal file
30
ModernKeePass/Views/MainPageFrames/DonatePage.xaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="ModernKeePass.Views.DonatePage"
|
||||||
|
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"
|
||||||
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
|
xmlns:converters="using:ModernKeePass.Converters"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Page.DataContext>
|
||||||
|
<viewModels:DonateVm />
|
||||||
|
</Page.DataContext>
|
||||||
|
<Page.Resources>
|
||||||
|
<converters:NullToBooleanConverter x:Key="NullToBooleanConverter"/>
|
||||||
|
<CollectionViewSource
|
||||||
|
x:Name="DonateItemsSource"
|
||||||
|
Source="{Binding Donations}" />
|
||||||
|
</Page.Resources>
|
||||||
|
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
<TextBlock x:Uid="DonateDesc" Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
<ItemsControl ItemsSource="{Binding Source={StaticResource DonateItemsSource}}" Margin="0,10,0,10">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<RadioButton GroupName="DonateOptions" Content="{Binding FormattedPrice}" Checked="ToggleButton_OnChecked" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
<Button x:Uid="DonateButton" Click="ButtonBase_OnClick" IsEnabled="{Binding SelectedItem, Converter={StaticResource NullToBooleanConverter}}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Page>
|
71
ModernKeePass/Views/MainPageFrames/DonatePage.xaml.cs
Normal file
71
ModernKeePass/Views/MainPageFrames/DonatePage.xaml.cs
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
using System;
|
||||||
|
using Windows.ApplicationModel.Store;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using ModernKeePass.Common;
|
||||||
|
using ModernKeePass.Services;
|
||||||
|
using ModernKeePass.ViewModels;
|
||||||
|
|
||||||
|
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
|
namespace ModernKeePass.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class DonatePage
|
||||||
|
{
|
||||||
|
public DonateVm Model => DataContext as DonateVm;
|
||||||
|
|
||||||
|
public DonatePage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ToggleButton_OnChecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var source = sender as RadioButton;
|
||||||
|
Model.SelectedItem = source?.DataContext as ProductListing;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var resource = new ResourcesService();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = await Model.Purchase();
|
||||||
|
switch ((LicenseService.PurchaseResult)result)
|
||||||
|
{
|
||||||
|
case LicenseService.PurchaseResult.Succeeded:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonateSucceededTitle"), resource.GetResourceValue("DonateSucceededMessage"));
|
||||||
|
break;
|
||||||
|
case LicenseService.PurchaseResult.NothingToFulfill:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonateNothingToFulfillTitle"), resource.GetResourceValue("DonateNothingToFulfillMessage"));
|
||||||
|
break;
|
||||||
|
case LicenseService.PurchaseResult.PurchasePending:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonatePurchasePendingTitle"), resource.GetResourceValue("DonatePurchasePendingMessage"));
|
||||||
|
break;
|
||||||
|
case LicenseService.PurchaseResult.PurchaseReverted:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonatePurchaseRevertedTitle"), resource.GetResourceValue("DonatePurchaseRevertedMessage"));
|
||||||
|
break;
|
||||||
|
case LicenseService.PurchaseResult.ServerError:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonateServerErrorTitle"), resource.GetResourceValue("DonateServerErrorMessage"));
|
||||||
|
break;
|
||||||
|
case LicenseService.PurchaseResult.NotPurchased:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonateNotPurchasedTitle"), resource.GetResourceValue("DonateNotPurchasedMessage"));
|
||||||
|
break;
|
||||||
|
// Should never happen because these are consumables
|
||||||
|
case LicenseService.PurchaseResult.AlreadyPurchased:
|
||||||
|
MessageDialogHelper.ShowNotificationDialog(resource.GetResourceValue("DonateAlreadyPurchasedTitle"), resource.GetResourceValue("DonateAlreadyPurchasedMessage"));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
MessageDialogHelper.ShowErrorDialog(exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.NewDatabasePage"
|
x:Class="ModernKeePass.Views.NewDatabasePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||||
|
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
@@ -23,15 +24,17 @@
|
|||||||
<Border HorizontalAlignment="Left" BorderThickness="1" BorderBrush="AliceBlue" Width="550" Visibility="{Binding ShowPasswordBox, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<Border HorizontalAlignment="Left" BorderThickness="1" BorderBrush="AliceBlue" Width="550" Visibility="{Binding ShowPasswordBox, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<StackPanel Margin="25,0,25,0">
|
<StackPanel Margin="25,0,25,0">
|
||||||
<TextBlock Text="{Binding Name}" />
|
<TextBlock Text="{Binding Name}" />
|
||||||
<local:CompositeKeyUserControl CreateNew="True" ButtonLabel="Save" >
|
<userControls:CompositeKeyUserControl CreateNew="True" ButtonLabel="Save" >
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="ValidationChecked">
|
<core:EventTriggerBehavior EventName="ValidationChecked">
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.GroupDetailPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.GroupDetailPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</local:CompositeKeyUserControl>
|
</userControls:CompositeKeyUserControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -6,7 +6,7 @@ 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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
@@ -7,7 +7,8 @@
|
|||||||
xmlns:local="using:ModernKeePass.Controls"
|
xmlns:local="using:ModernKeePass.Controls"
|
||||||
xmlns:converters="using:ModernKeePass.Converters"
|
xmlns:converters="using:ModernKeePass.Converters"
|
||||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
|
||||||
x:Class="ModernKeePass.Pages.OpenDatabasePage"
|
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||||
|
x:Class="ModernKeePass.Views.OpenDatabasePage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
@@ -24,13 +25,13 @@
|
|||||||
<Border HorizontalAlignment="Left" BorderThickness="1" BorderBrush="AliceBlue" Width="550" Visibility="{Binding ShowPasswordBox, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<Border HorizontalAlignment="Left" BorderThickness="1" BorderBrush="AliceBlue" Width="550" Visibility="{Binding ShowPasswordBox, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<StackPanel Margin="25,0,25,0">
|
<StackPanel Margin="25,0,25,0">
|
||||||
<TextBlock Text="{Binding Name}" />
|
<TextBlock Text="{Binding Name}" />
|
||||||
<local:CompositeKeyUserControl x:Uid="CompositeKeyOpenButton">
|
<userControls:CompositeKeyUserControl x:Uid="CompositeKeyOpenButton">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<Core:EventTriggerBehavior EventName="ValidationChecked">
|
<Core:EventTriggerBehavior EventName="ValidationChecked">
|
||||||
<Core:NavigateToPageAction TargetPage="ModernKeePass.Pages.GroupDetailPage" />
|
<Core:NavigateToPageAction TargetPage="ModernKeePass.Views.GroupDetailPage" />
|
||||||
</Core:EventTriggerBehavior>
|
</Core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</local:CompositeKeyUserControl>
|
</userControls:CompositeKeyUserControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
@@ -3,12 +3,11 @@ using Windows.Storage.Pickers;
|
|||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
using ModernKeePass.Events;
|
|
||||||
using ModernKeePass.ViewModels;
|
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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
@@ -8,7 +8,8 @@
|
|||||||
xmlns:converters="using:ModernKeePass.Converters"
|
xmlns:converters="using:ModernKeePass.Converters"
|
||||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
|
||||||
x:Class="ModernKeePass.Pages.RecentDatabasesPage"
|
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||||
|
x:Class="ModernKeePass.Views.RecentDatabasesPage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
@@ -50,17 +51,17 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="{Binding Name}" Padding="5,0,0,0" />
|
<TextBlock Grid.Row="0" Text="{Binding Name}" Padding="5,0,0,0" />
|
||||||
<TextBlock Grid.Row="1" Text="{Binding Path}" Padding="5,0,0,0" FontSize="10" />
|
<TextBlock Grid.Row="1" Text="{Binding Path}" Padding="5,0,0,0" FontSize="10" />
|
||||||
<local:CompositeKeyUserControl Grid.Row="2" x:Name="DatabaseUserControl" x:Uid="CompositeKeyOpenButton" HorizontalAlignment="Stretch" MinWidth="400" Margin="0,10,0,0" Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<userControls:CompositeKeyUserControl Grid.Row="2" x:Name="DatabaseUserControl" x:Uid="CompositeKeyOpenButton" HorizontalAlignment="Stretch" MinWidth="400" Margin="0,10,0,0" Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="ValidationChecking">
|
<core:EventTriggerBehavior EventName="ValidationChecking">
|
||||||
<core:CallMethodAction TargetObject="{Binding}" MethodName="OpenDatabaseFile" />
|
<core:CallMethodAction TargetObject="{Binding}" MethodName="OpenDatabaseFile" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
<core:EventTriggerBehavior EventName="ValidationChecked">
|
<core:EventTriggerBehavior EventName="ValidationChecked">
|
||||||
<core:CallMethodAction TargetObject="{Binding}" MethodName="UpdateAccessTime" />
|
<core:CallMethodAction TargetObject="{Binding}" MethodName="UpdateAccessTime" />
|
||||||
<core:NavigateToPageAction TargetPage="ModernKeePass.Pages.GroupDetailPage" />
|
<core:NavigateToPageAction TargetPage="ModernKeePass.Views.GroupDetailPage" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</local:CompositeKeyUserControl>
|
</userControls:CompositeKeyUserControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
@@ -1,6 +1,6 @@
|
|||||||
// Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
|
// Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
namespace ModernKeePass.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
|
/// Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
|
@@ -4,7 +4,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
x:Class="ModernKeePass.Pages.SaveDatabasePage"
|
x:Class="ModernKeePass.Views.SaveDatabasePage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.DataContext>
|
<Page.DataContext>
|
||||||
<viewModels:SaveVm/>
|
<viewModels:SaveVm/>
|
@@ -8,7 +8,7 @@ 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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
@@ -31,7 +31,7 @@ namespace ModernKeePass.Pages
|
|||||||
private void SaveButton_OnClick(object sender, RoutedEventArgs e)
|
private void SaveButton_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Model.Save();
|
Model.Save();
|
||||||
_mainFrame.Navigate(typeof(MainPage));
|
_mainFrame.Navigate(typeof(Views.MainPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void SaveAsButton_OnClick(object sender, RoutedEventArgs e)
|
private async void SaveAsButton_OnClick(object sender, RoutedEventArgs e)
|
||||||
@@ -47,7 +47,7 @@ namespace ModernKeePass.Pages
|
|||||||
if (file == null) return;
|
if (file == null) return;
|
||||||
Model.Save(file);
|
Model.Save(file);
|
||||||
|
|
||||||
_mainFrame.Navigate(typeof(MainPage));
|
_mainFrame.Navigate(typeof(Views.MainPage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.WelcomePage"
|
x:Class="ModernKeePass.Views.WelcomePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
15
ModernKeePass/Views/MainPageFrames/WelcomePage.xaml.cs
Normal file
15
ModernKeePass/Views/MainPageFrames/WelcomePage.xaml.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
|
namespace ModernKeePass.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class WelcomePage
|
||||||
|
{
|
||||||
|
public WelcomePage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -3,11 +3,11 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:basePages="using:ModernKeePass.Pages.BasePages"
|
|
||||||
xmlns:controls="using:ModernKeePass.Controls"
|
xmlns:controls="using:ModernKeePass.Controls"
|
||||||
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
||||||
|
xmlns:basePages="using:ModernKeePass.Views.BasePages"
|
||||||
x:Name="PageRoot"
|
x:Name="PageRoot"
|
||||||
x:Class="ModernKeePass.Pages.SettingsPage"
|
x:Class="ModernKeePass.Views.SettingsPage"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Page.Resources>
|
<Page.Resources>
|
||||||
<CollectionViewSource x:Name="MenuItemsSource" Source="{Binding MenuItems}" IsSourceGrouped="True" />
|
<CollectionViewSource x:Name="MenuItemsSource" Source="{Binding MenuItems}" IsSourceGrouped="True" />
|
@@ -1,10 +1,9 @@
|
|||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using ModernKeePass.Pages.SettingsPageFrames;
|
|
||||||
using ModernKeePass.ViewModels;
|
using ModernKeePass.ViewModels;
|
||||||
|
|
||||||
// The Split Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234234
|
// The Split Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234234
|
||||||
|
|
||||||
namespace ModernKeePass.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A page that displays a group title, a list of items within the group, and details for
|
/// A page that displays a group title, a list of items within the group, and details for
|
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.SettingsDatabasePage"
|
x:Class="ModernKeePass.Views.SettingsDatabasePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
@@ -1,6 +1,6 @@
|
|||||||
// 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.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.SettingsPageFrames.SettingsNewDatabasePage"
|
x:Class="ModernKeePass.Views.SettingsNewDatabasePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
@@ -1,6 +1,6 @@
|
|||||||
// Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
|
// Pour en savoir plus sur le modèle d'élément Page vierge, consultez la page http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
namespace ModernKeePass.Pages.SettingsPageFrames
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
|
/// Une page vide peut être utilisée seule ou constituer une page de destination au sein d'un frame.
|
@@ -1,10 +1,11 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.SettingsSecurityPage"
|
x:Class="ModernKeePass.Views.SettingsSecurityPage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:ModernKeePass.Controls"
|
xmlns:local="using:ModernKeePass.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:userControls="using:ModernKeePass.Views.UserControls"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
@@ -14,6 +15,6 @@
|
|||||||
<Run x:Uid="SettingsSecurityDesc2" FontWeight="SemiBold" />
|
<Run x:Uid="SettingsSecurityDesc2" FontWeight="SemiBold" />
|
||||||
<Run x:Uid="SettingsSecurityDesc3" />
|
<Run x:Uid="SettingsSecurityDesc3" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<local:CompositeKeyUserControl Margin="0,20,0,0" UpdateKey="True" x:Uid="SettingsSecurityUpdateButton" ValidationChecked="CompositeKeyUserControl_OnValidationChecked" />
|
<userControls:CompositeKeyUserControl Margin="0,20,0,0" UpdateKey="True" x:Uid="SettingsSecurityUpdateButton" ValidationChecked="CompositeKeyUserControl_OnValidationChecked" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Page>
|
</Page>
|
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Events;
|
using ModernKeePass.Events;
|
||||||
using ModernKeePass.Services;
|
|
||||||
|
|
||||||
namespace ModernKeePass.Pages
|
namespace ModernKeePass.Views
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
@@ -1,5 +1,5 @@
|
|||||||
<Page
|
<Page
|
||||||
x:Class="ModernKeePass.Pages.SettingsPageFrames.SettingsWelcomePage"
|
x:Class="ModernKeePass.Views.SettingsWelcomePage"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
@@ -0,0 +1,15 @@
|
|||||||
|
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||||
|
|
||||||
|
namespace ModernKeePass.Views
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class SettingsWelcomePage
|
||||||
|
{
|
||||||
|
public SettingsWelcomePage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
<UserControl x:Name="UserControl"
|
<UserControl x:Name="UserControl"
|
||||||
x:Class="ModernKeePass.Controls.CompositeKeyUserControl"
|
x:Class="ModernKeePass.Views.UserControls.CompositeKeyUserControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Windows.Storage.Pickers;
|
using Windows.Storage.Pickers;
|
||||||
using Windows.System;
|
using Windows.System;
|
||||||
using Windows.UI.Core;
|
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
using Windows.UI.Xaml.Input;
|
using Windows.UI.Xaml.Input;
|
||||||
using ModernKeePass.Events;
|
using ModernKeePass.Events;
|
||||||
@@ -13,7 +11,7 @@ using ModernKeePass.ViewModels;
|
|||||||
|
|
||||||
// Pour en savoir plus sur le modèle d'élément Contrôle utilisateur, consultez la page http://go.microsoft.com/fwlink/?LinkId=234236
|
// Pour en savoir plus sur le modèle d'élément Contrôle utilisateur, consultez la page http://go.microsoft.com/fwlink/?LinkId=234236
|
||||||
|
|
||||||
namespace ModernKeePass.Controls
|
namespace ModernKeePass.Views.UserControls
|
||||||
{
|
{
|
||||||
public sealed partial class CompositeKeyUserControl
|
public sealed partial class CompositeKeyUserControl
|
||||||
{
|
{
|
@@ -3,9 +3,8 @@ using System.Linq;
|
|||||||
using Windows.ApplicationModel;
|
using Windows.ApplicationModel;
|
||||||
using Windows.Storage.AccessCache;
|
using Windows.Storage.AccessCache;
|
||||||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||||
using ModernKeePass.Pages;
|
|
||||||
using ModernKeePass.Pages.SettingsPageFrames;
|
|
||||||
using ModernKeePass.ViewModels;
|
using ModernKeePass.ViewModels;
|
||||||
|
using ModernKeePass.Views;
|
||||||
using ModernKeePassApp.Test.Mock;
|
using ModernKeePassApp.Test.Mock;
|
||||||
|
|
||||||
namespace ModernKeePassApp.Test
|
namespace ModernKeePassApp.Test
|
||||||
@@ -31,7 +30,7 @@ namespace ModernKeePassApp.Test
|
|||||||
var mainVm = new MainVm(null, null, database, _resource, _recent);
|
var mainVm = new MainVm(null, null, database, _resource, _recent);
|
||||||
Assert.AreEqual(1, mainVm.MainMenuItems.Count());
|
Assert.AreEqual(1, mainVm.MainMenuItems.Count());
|
||||||
var firstGroup = mainVm.MainMenuItems.FirstOrDefault();
|
var firstGroup = mainVm.MainMenuItems.FirstOrDefault();
|
||||||
Assert.AreEqual(6, firstGroup.Count());
|
Assert.AreEqual(7, firstGroup.Count());
|
||||||
|
|
||||||
database.Status = 1;
|
database.Status = 1;
|
||||||
mainVm = new MainVm(null, null, database, _resource, _recent);
|
mainVm = new MainVm(null, null, database, _resource, _recent);
|
||||||
|
Reference in New Issue
Block a user