aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs43
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();
+ });
}
}
}