aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/ViewModel.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/ViewModel.cs18
1 files changed, 13 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs
index d4f26c79d..421e098ce 100644
--- a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs
@@ -23,7 +23,6 @@ namespace Tango.SharedUI
public abstract class ViewModel : ExtendedObject, INotifyDataErrorInfo
{
private List<KeyValuePair<String, String>> _currentErrors = new List<KeyValuePair<string, string>>(); //Holds the current validation errors.
- private bool _isFreeSet;
private bool _hasErrors;
/// <summary>
@@ -35,14 +34,23 @@ namespace Tango.SharedUI
set { _hasErrors = value; RaisePropertyChangedAuto(); }
}
- private bool _isFree;
+ private bool _isBusy;
+ /// <summary>
+ /// Gets or sets a value indicating whether this view model is currently busy doing operations.
+ /// </summary>
+ public bool IsBusy
+ {
+ get { return _isBusy; }
+ set { _isBusy = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsFree)); InvalidateRelayCommands(); }
+ }
+
/// <summary>
/// Gets or sets a value indicating whether this view model is free to perform actions.
/// </summary>
public bool IsFree
{
- get { return _isFree; }
- set { _isFree = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ get { return !IsBusy; }
+ set { IsBusy = !value; }
}
private ObservableCollection<String> _validationErrors;
@@ -184,7 +192,7 @@ namespace Tango.SharedUI
/// </summary>
public ViewModel() : base()
{
- TangoIOC.Default.GetInstanceWhenAvailable<T>((view) =>
+ TangoIOC.Default.GetInstanceWhenAvailable<T>((view) =>
{
View = view;
OnViewAttached();