diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs index b3869daff..71dc96774 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -574,17 +575,25 @@ namespace Tango.SharedUI.Controls var element = Elements.SingleOrDefault(x => GetNavigationName(x) == navigationName || x.GetType().Name == navigationName); - if (element != null) + Task.Factory.StartNew(() => { - if (SelectedElement == element) - { - _onCompleted?.Invoke(); - } - else + Thread.Sleep(10); + + Dispatcher.BeginInvoke(new Action(() => { - SelectedElement = element; - } - } + if (element != null) + { + if (SelectedElement == element) + { + _onCompleted?.Invoke(); + } + else + { + SelectedElement = element; + } + } + })); + }); return element; } |
