aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs34
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();
- }
- }
}
}