diff options
| author | Roy <roy.mail.net@gmail.com> | 2017-12-24 02:27:16 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2017-12-24 02:27:16 +0200 |
| commit | 53db041e636bb3802dbe3cb911de6ef6ef41446c (patch) | |
| tree | 9be0b0961a31fea4a60f5a9c1741363fa313a13b /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs | |
| parent | ceac40d058a8554638aa3fa39d4697f3fbfe62f8 (diff) | |
| download | Tango-53db041e636bb3802dbe3cb911de6ef6ef41446c.tar.gz Tango-53db041e636bb3802dbe3cb911de6ef6ef41446c.zip | |
Continue for last commit.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs new file mode 100644 index 000000000..e5e4cac78 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/DialogViewVM.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Common.Notifications +{ + public abstract class DialogViewVM : ViewModel + { + public event Action Accepted; + public event Action Canceled; + + public DialogViewVM() + { + CanClose = true; + CloseCommand = new RelayCommand(Cancel, (x) => CanClose); + } + + private bool _canClose; + + public bool CanClose + { + get { return _canClose; } + set { _canClose = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand CloseCommand { get; set; } + + public virtual void OnShow() + { + + } + + protected virtual void Accept() + { + Accepted?.Invoke(); + } + + protected virtual void Cancel() + { + Canceled?.Invoke(); + } + } +} |
