diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-02-03 14:31:17 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-02-03 14:31:17 +0200 |
| commit | 9fa032b7aea6f2fbfdae05d21c3c10db174e1662 (patch) | |
| tree | 86c6ad4309bddc7d0641d344584998bc51a22722 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs | |
| parent | be23e3a8def254ecb161ad21d82024987097ba1d (diff) | |
| download | Tango-9fa032b7aea6f2fbfdae05d21c3c10db174e1662.tar.gz Tango-9fa032b7aea6f2fbfdae05d21c3c10db174e1662.zip | |
Same as previous..
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs index bcded15cf..e6e1557f3 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs @@ -22,6 +22,9 @@ using Tango.MachineStudio.UI.SupervisingController; using Tango.SharedUI; using Tango.SharedUI.Controls; using Tango.MachineStudio.Common; +using System.Threading; +using Tango.Core.Helpers; +using Tango.SharedUI.Helpers; namespace Tango.MachineStudio.UI.Views { @@ -49,16 +52,44 @@ namespace Tango.MachineStudio.UI.Views { TransitionControl.Controls.RemoveAll((x) => x.Tag.ToString() != "Home"); - foreach (var module in _loader.UserModules) + Task.Factory.StartNew(() => { - TransitionControl.Controls.Add(new ContentControl() + var item = ServiceLocator.Current.GetInstance<INotificationProvider>().PushTaskItem("Loading Modules..."); + + var modules = _loader.UserModules.ToList(); + + ThreadsHelper.InvokeUINow(() => + { + _loader.UserModules.Clear(); + }); + + Thread.Sleep(1500); + + foreach (var module in modules) + { + ThreadsHelper.InvokeUI(() => + { + TransitionControl.Controls.Add(new ContentControl() + { + Tag = module.Name, + Content = module.MainView + }); + + _loader.UserModules.Add(module); + }); + + UIHelper.DoEvents(); + + Thread.Sleep(100); + } + + ThreadsHelper.InvokeUI(() => { - Tag = module.Name, - Content = module.MainView + TransitionControl.RefreshControls(); }); - } - TransitionControl.RefreshControls(); + item.Pop(); + }); } } } |
