mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Recycle bin restore function (actually implemented a move functionality, for later)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user