1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using ComPDFKit.PDFDocument;
- using PDF_Office.Model;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
- {
- public class CancelPasswordDialogViewModel : BindableBase,IDialogAware
- {
-
- public IDialogService dialogs;
- private CPDFDocument document;
-
- public DelegateCommand CheckPasswordCommand { get; set; }
- public CancelPasswordDialogViewModel(IDialogService dialogService)
- {
- dialogs = dialogService;
- CheckPasswordCommand = new DelegateCommand(OpenCheckPassword);
- }
- private void OpenCheckPassword()
- {
- DialogParameters value = new DialogParameters();
- value.Add("1", 1);
- RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
- dialogs.ShowDialog(DialogNames.CheckPasswordDialog, value, e => {
- });
- }
- public string Title => "";
- public event Action<IDialogResult> RequestClose;
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
- CPDFDocument doc = null;
- parameters.TryGetValue<CPDFDocument>(ParameterNames.PDFDocument, out doc);
- if (doc != null)
- {
- document = doc;
- }
- }
- }
- }
|