Recycle bin restore function (actually implemented a move functionality, for later)

This commit is contained in:
2017-10-31 18:49:18 +01:00
committed by BONNEVILLE Geoffroy
parent d32f312d60
commit 7e642e3b73
16 changed files with 163 additions and 141 deletions

View File

@@ -1,25 +1,17 @@
using System;
using Windows.UI.Popups;
using Windows.UI.Xaml.Controls;
using ModernKeePass.Interfaces;
using ModernKeePass.ViewModels;
namespace ModernKeePass.Common
{
public static class MessageDialogHelper
{
public static async void ShowDeleteConfirmationDialog(string text, IPwEntity model, Frame backFrame)
public static async void ShowDeleteConfirmationDialog(string actionText, string contentText, UICommandInvokedHandler action)
{
// Create the message dialog and set its content
var messageDialog = new MessageDialog(text);
var messageDialog = new MessageDialog(contentText);
// Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
messageDialog.Commands.Add(new UICommand("Delete", delete =>
{
ToastNotificationHelper.ShowUndoToast(model);
model.MarkForDelete();
if (backFrame.CanGoBack) backFrame.GoBack();
}));
messageDialog.Commands.Add(new UICommand(actionText, action));
messageDialog.Commands.Add(new UICommand("Cancel"));
// Set the command that will be invoked by default