diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs b/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs index ae6d54bc6..3154be545 100644 --- a/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs +++ b/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs @@ -24,7 +24,7 @@ namespace Tango.SharedUI { CanClose = true; CloseCommand = new RelayCommand(Cancel, (x) => CanClose); - OKCommand = new RelayCommand(Accept, (x) => CanOK()); + OKCommand = new RelayCommand(Accept, (x) => CanClose && CanOK()); } private bool _canClose; @@ -37,17 +37,6 @@ namespace Tango.SharedUI set { _canClose = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } - private bool _isVisible; - /// <summary> - /// Gets or sets a value indicating whether this instance is visible. - /// </summary> - public bool IsVisible - { - get { return _isVisible; } - set { _isVisible = value; RaisePropertyChangedAuto(); } - } - - /// <summary> /// Determines whether this instance can invoke the OK command. /// </summary> @@ -76,7 +65,7 @@ namespace Tango.SharedUI /// </summary> public virtual void OnShow() { - IsVisible = true; + } /// <summary> @@ -84,7 +73,6 @@ namespace Tango.SharedUI /// </summary> protected virtual void Accept() { - IsVisible = false; DialogResult = true; Accepted?.Invoke(); } @@ -94,25 +82,7 @@ namespace Tango.SharedUI /// </summary> protected virtual void Cancel() { - IsVisible = false; Canceled?.Invoke(); } - - /// <summary> - /// Closes the dialog with the specified result. - /// </summary> - /// <param name="result">if set to <c>true</c> accepted.</param> - public void Close(bool result) - { - DialogResult = result; - if (result) - { - Accept(); - } - else - { - Cancel(); - } - } } } |
