From 2ef57b73b1dc6da51a9c3353d93a815f58ea22e0 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 17 Nov 2020 16:35:03 +0200 Subject: Fixed error wording on FSE firmware logs failure. Added support for raise property changed on UI thread for view model base. --- Software/Visual_Studio/Tango.SharedUI/ViewModel.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.SharedUI') diff --git a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs index 421e098ce..564d8fce0 100644 --- a/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs +++ b/Software/Visual_Studio/Tango.SharedUI/ViewModel.cs @@ -41,7 +41,7 @@ namespace Tango.SharedUI public bool IsBusy { get { return _isBusy; } - set { _isBusy = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsFree)); InvalidateRelayCommands(); } + set { _isBusy = value; RaisePropertyChanged(nameof(IsBusy), true); RaisePropertyChanged(nameof(IsFree), true); InvalidateRelayCommands(); } } /// @@ -172,6 +172,18 @@ namespace Tango.SharedUI { TangoMessenger.Default.Register(handler); } + + /// + /// Raises the property changed event. + /// + /// Name of the property. + protected virtual void RaisePropertyChanged(String propName, bool onUIThread) + { + InvokeUI(() => + { + RaisePropertyChanged(propName); + }); + } } /// -- cgit v1.3.1