123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using ComPDFKit.PDFAnnotation;
- using ComPDFKitViewer.PdfViewer;
- using PDF_Office.Model;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Controls;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
- {
- class DynamicPropertyDialogViewModel : BindableBase, IDialogAware
- {
- public string Title => ".";
- public event Action<IDialogResult> RequestClose;
- public DelegateCommand CancelCommand { get; set; }
- public DelegateCommand ApplyCommnad { get; set; }
- public ObservableCollection<string> DateFormatList { get; set; }
- private bool isChecked = true;
- public bool IsChecked
- {
- get { return isChecked; }
- set
- {
- SetProperty(ref isChecked, value);
- }
- }
- private string author = "Kdan";
- public string Author
- {
- get { return author; }
- set
- {
- SetProperty(ref author, value);
- }
- }
- private int selectedIndex = 0;
- public int SelectedIndex
- {
- get { return selectedIndex; }
- set
- {
- SetProperty(ref selectedIndex, value);
- }
- }
- public DynamicPropertyDialogViewModel()
- {
- CancelCommand = new DelegateCommand(Cancel);
- ApplyCommnad = new DelegateCommand(Apply);
- DateFormatList = new ObservableCollection<string>
- {
- "Defualt",
- "M/d", "M/d/yy", "M/d/yyyy", "MM/dd/yy","MM/dd/yyyy",
- "d/M/y","d/M/yyy","dd/MM/yy","dd/MM/yyy","MM/yy","MM/yyyy",
- "M.d.y","M.d.yyyy","MM.dd.yy","MM.dd.yyyy","MM/yy","MM/yyyy",
- "d.M.y","d.M.yyyy","dd.MM.yy","dd.MM.yyyy","yy-MM-dd","yyyy-MM-dd"
- };
- }
- private void Cancel()
- {
- RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
- }
- private void Apply()
- {
- DialogParameters valuePairs = new DialogParameters();
- valuePairs.Add(ParameterNames.DataModel, this);
- RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
- }
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
- return;
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
- return;
- }
- }
- }
|