Lots of code refactoring to use XAML behaviors instead of code-behind

New Save button in the AppBar
EntryPage now uses the same AppBar as GroupPage (but not shared...)
Some new Symbol mappings
This commit is contained in:
2017-10-25 18:29:50 +02:00
committed by BONNEVILLE Geoffroy
parent 8cd3801897
commit 46c8429cde
26 changed files with 241 additions and 179 deletions

View File

@@ -4,12 +4,13 @@ using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
using Windows.UI.Xaml;
using ModernKeePass.Interfaces;
using ModernKeePass.ViewModels;
namespace ModernKeePass.Common
{
public static class ToastNotificationHelper
{
public static /*async*/ void ShowUndoToast(string entityType, IPwEntity entity)
public static /*async*/ void ShowUndoToast(IPwEntity entity)
{
// This is for Windows 10
// Construct the visuals of the toast
@@ -64,6 +65,8 @@ namespace ModernKeePass.Common
var toast = new ToastNotification(toastXml) {ExpirationTime = DateTime.Now.AddSeconds(5)};
toast.Dismissed += Toast_Dismissed;
*/
var entityType = entity is GroupVm ? "Group" : "Entry";
var notificationXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);
var toastElements = notificationXml.GetElementsByTagName("text");
toastElements[0].AppendChild(notificationXml.CreateTextNode($"{entityType} {entity.Name} deleted"));