From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../Visual_Studio/Tango.SharedUI/DialogViewVM.cs | 34 ++-------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs') 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; - /// - /// Gets or sets a value indicating whether this instance is visible. - /// - public bool IsVisible - { - get { return _isVisible; } - set { _isVisible = value; RaisePropertyChangedAuto(); } - } - - /// /// Determines whether this instance can invoke the OK command. /// @@ -76,7 +65,7 @@ namespace Tango.SharedUI /// public virtual void OnShow() { - IsVisible = true; + } /// @@ -84,7 +73,6 @@ namespace Tango.SharedUI /// protected virtual void Accept() { - IsVisible = false; DialogResult = true; Accepted?.Invoke(); } @@ -94,25 +82,7 @@ namespace Tango.SharedUI /// protected virtual void Cancel() { - IsVisible = false; Canceled?.Invoke(); } - - /// - /// Closes the dialog with the specified result. - /// - /// if set to true accepted. - public void Close(bool result) - { - DialogResult = result; - if (result) - { - Accept(); - } - else - { - Cancel(); - } - } } } -- cgit v1.3.1