|
@@ -8,11 +8,13 @@ using Prism.Services.Dialogs;
|
|
|
using PDF_Master.Model.PageEdit;
|
|
|
using Prism.Commands;
|
|
|
using PDF_Master.Model;
|
|
|
+using ComPDFKitViewer.PdfViewer;
|
|
|
|
|
|
namespace PDF_Master.ViewModels.Dialog.PageEditDialogs
|
|
|
{
|
|
|
- public class ExtractDialogViewModel:BindableBase,IDialogAware
|
|
|
+ public class ExtractDialogViewModel : BindableBase, IDialogAware
|
|
|
{
|
|
|
+ private bool isDeleteAfterExtract = true;
|
|
|
public string Title => "";
|
|
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
@@ -32,6 +34,16 @@ namespace PDF_Master.ViewModels.Dialog.PageEditDialogs
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private bool isEnabledDeleteAfterExtract = true;
|
|
|
+
|
|
|
+ public bool IsEnabledDeleteAfterExtract
|
|
|
+ {
|
|
|
+ get { return isEnabledDeleteAfterExtract; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref isEnabledDeleteAfterExtract, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public ExtractDialogViewModel()
|
|
|
{
|
|
@@ -48,8 +60,8 @@ namespace PDF_Master.ViewModels.Dialog.PageEditDialogs
|
|
|
private void extract()
|
|
|
{
|
|
|
DialogParameters valuePairs = new DialogParameters();
|
|
|
- valuePairs.Add(ParameterNames.DataModel,Model);
|
|
|
- RequestClose.Invoke(new DialogResult(ButtonResult.OK,valuePairs));
|
|
|
+ valuePairs.Add(ParameterNames.DataModel, Model);
|
|
|
+ RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
|
|
|
}
|
|
|
|
|
|
public bool CanCloseDialog()
|
|
@@ -64,7 +76,8 @@ namespace PDF_Master.ViewModels.Dialog.PageEditDialogs
|
|
|
|
|
|
public void OnDialogOpened(IDialogParameters parameters)
|
|
|
{
|
|
|
-
|
|
|
+ parameters.TryGetValue<bool>(ParameterNames.IsDeleteAfterExtract, out isDeleteAfterExtract);
|
|
|
+ IsEnabledDeleteAfterExtract = isDeleteAfterExtract ? true : false;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|