aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
committerAvi Levkovich <avi@twine-s.com>2018-02-20 16:45:00 +0200
commit6c208c90bc45aff4a7fa214356a42fe7757c5e6f (patch)
tree0d77bc6a0ecfbb53cf42c5462ee19212197ee1bd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views
parentb0823127f152fe97a6e8fce29e427c7f3db9cf5a (diff)
parent1a573aaa346ec4b8bd58a0e35ab9df571a09b855 (diff)
downloadTango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.tar.gz
Tango-6c208c90bc45aff4a7fa214356a42fe7757c5e6f.zip
MERGE
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml48
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml199
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs60
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml2
6 files changed, 183 insertions, 130 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml
index 459c8fde8..2478c1155 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoadingView.xaml
@@ -6,7 +6,7 @@
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" DataContext="{Binding LoadingViewVM, Source={StaticResource Locator}}" Background="White">
+ d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" DataContext="{Binding LoadingViewVM, Source={StaticResource Locator}}" Background="Transparent">
<Grid>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
index 1531370af..84ba597f2 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
@@ -7,7 +7,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" DataContext="{Binding LoginViewVM, Source={StaticResource Locator}}" Background="White">
+ d:DesignHeight="720" d:DesignWidth="1280" DataContext="{Binding LoginViewVM, Source={StaticResource Locator}}" Background="Transparent">
<UserControl.Resources>
<rules:Required x:Key="Required"></rules:Required>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
index 4208c2878..1626e67ef 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml
@@ -5,6 +5,7 @@
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:integration="clr-namespace:Tango.Integration.Services;assembly=Tango.Integration"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
@@ -43,7 +44,7 @@
</Grid.RowDefinitions>
<Grid>
- <TextBlock VerticalAlignment="Center" Margin="0 0 0 0" Text="Scanning for machine on your local network..."></TextBlock>
+ <TextBlock VerticalAlignment="Center" Margin="0 0 0 0" Text="Scanning for machines on your local environment..."></TextBlock>
<!--<Button Command="{Binding ScanCommand}" HorizontalAlignment="Right" Width="40" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" Foreground="Black" ToolTip="Scan">
<materialDesign:PackIcon Kind="Refresh" Width="24" Height="24"></materialDesign:PackIcon>
@@ -51,21 +52,15 @@
</Grid>
<Grid Grid.Row="1">
- <ListBox ItemsSource="{Binding Scanner.AvailableMachines}" SelectedItem="{Binding SelectedMachine}" Margin="0 0 0 7" BorderThickness="1" BorderBrush="Gainsboro">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
+ <ListBox ItemsSource="{Binding Scanner.AvailableMachines}" SelectedItem="{Binding SelectedMachine}" Margin="0 0 0 7" BorderThickness="1" BorderBrush="Gainsboro" HorizontalContentAlignment="Stretch">
+ <ListBox.Resources>
+ <DataTemplate DataType="{x:Type integration:ExternalBridgeTcpClient}">
+ <DockPanel>
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center" DockPanel.Dock="Right" ToolTip="Allow incoming diagnostics data">
+ <ToggleButton IsChecked="{Binding EnableDiagnostics}" VerticalAlignment="Center"></ToggleButton>
+ <TextBlock VerticalAlignment="Center" FontSize="10">Diagnostics</TextBlock>
+ </StackPanel>
<StackPanel Orientation="Horizontal">
- <StackPanel.Style>
- <Style TargetType="StackPanel">
- <Setter Property="Visibility" Value="Visible"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Type}" Value="USB">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </StackPanel.Style>
<Image Source="/Images/external-bridge-tcp.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="11">
@@ -79,18 +74,15 @@
</TextBlock>
</StackPanel>
</StackPanel>
-
+ </DockPanel>
+ </DataTemplate>
+ <DataTemplate DataType="{x:Type integration:ExternalBridgeUsbClient}">
+ <DockPanel>
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center" DockPanel.Dock="Right" ToolTip="Allow incoming diagnostics data">
+ <ToggleButton IsChecked="{Binding EnableDiagnostics}" VerticalAlignment="Center"></ToggleButton>
+ <TextBlock VerticalAlignment="Center" FontSize="10">Diagnostics</TextBlock>
+ </StackPanel>
<StackPanel Orientation="Horizontal">
- <StackPanel.Style>
- <Style TargetType="StackPanel">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Type}" Value="USB">
- <Setter Property="Visibility" Value="Visible"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </StackPanel.Style>
<Image Source="/Images/external-bridge-usb.png" Width="38" Height="38" RenderOptions.BitmapScalingMode="Fant"></Image>
<StackPanel Margin="10 0 0 0">
<TextBlock FontSize="11">
@@ -101,9 +93,9 @@
</TextBlock>
</StackPanel>
</StackPanel>
- </Grid>
+ </DockPanel>
</DataTemplate>
- </ListBox.ItemTemplate>
+ </ListBox.Resources>
</ListBox>
<mahapps:MetroProgressBar VerticalAlignment="Bottom" Height="1" IsIndeterminate="True"></mahapps:MetroProgressBar>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index d7d0f8dc3..479052cc5 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz"
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
@@ -12,7 +13,12 @@
xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views;assembly=Tango.MachineStudio.DB"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1270" Background="White" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}">
+ d:DesignHeight="720" d:DesignWidth="1270" Background="Transparent" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}">
+
+ <UserControl.Resources>
+ <converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
+ </UserControl.Resources>
+
<Grid>
<Grid.Style>
<Style TargetType="Grid">
@@ -125,8 +131,23 @@
</StackPanel>
<Grid HorizontalAlignment="Right">
- <StackPanel Orientation="Horizontal">
- <Button Margin="10 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" FontSize="12" ToolTip="Connect to machine on the local network" BorderThickness="0" Command="{Binding ConnectCommand}">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <Grid Margin="0 0 20 0">
+ <ItemsControl ItemsSource="{Binding NotificationProvider.BarItems}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" IsItemsHost="True" VerticalAlignment="Center"></StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <ContentControl Margin="0 0 10 0" Content="{Binding Element}" VerticalAlignment="Center"></ContentControl>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </Grid>
+
+ <Button VerticalAlignment="Center" Margin="10 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" FontSize="12" ToolTip="Connect to machine on the local network" BorderThickness="0" Command="{Binding ConnectCommand}">
<!--<Button.Background>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="White" Offset="0.4" />
@@ -134,21 +155,25 @@
</LinearGradientBrush>
</Button.Background>-->
<StackPanel Orientation="Horizontal">
- <TextBlock Text="Machine Connection" VerticalAlignment="Center" Foreground="White"></TextBlock>
- <materialDesign:PackIcon Margin="10 0 0 0" Width="16" Height="16">
- <materialDesign:PackIcon.Style>
- <Style TargetType="materialDesign:PackIcon">
- <Setter Property="Foreground" Value="#FF6767"></Setter>
- <Setter Property="Kind" Value="LanDisconnect"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ApplicationManager.IsMachineConnected,Mode=OneWay}" Value="True">
- <Setter Property="Foreground" Value="#03FF8E"></Setter>
- <Setter Property="Kind" Value="LanConnect"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </materialDesign:PackIcon.Style>
- </materialDesign:PackIcon>
+ <Grid>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock Text="Machine Connection" VerticalAlignment="Center" Foreground="White"></TextBlock>
+ <materialDesign:PackIcon Margin="10 0 0 0" Width="24" Height="24">
+ <materialDesign:PackIcon.Style>
+ <Style TargetType="materialDesign:PackIcon">
+ <Setter Property="Foreground" Value="#333333"></Setter>
+ <Setter Property="Kind" Value="LanDisconnect"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding ApplicationManager.IsMachineConnected,Mode=OneWay}" Value="True">
+ <Setter Property="Foreground" Value="#03FF8E"></Setter>
+ <Setter Property="Kind" Value="LanConnect"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </materialDesign:PackIcon.Style>
+ </materialDesign:PackIcon>
+ </StackPanel>
+ </Grid>
</StackPanel>
</Button>
</StackPanel>
@@ -165,90 +190,66 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="150"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Grid>
- <StackPanel Margin="30 20" HorizontalAlignment="Left">
- <TextBlock Style="{StaticResource MaterialDesignDisplay1TextBlock}">Welcome to Machine Studio</TextBlock>
- <TextBlock HorizontalAlignment="Right" Margin="0 5 -130 0" FontStyle="Italic" Style="{StaticResource MaterialDesignSubheadingTextBlock}" Foreground="{StaticResource AccentColorBrush}">Select Your Studio Module...</TextBlock>
- </StackPanel>
- </Grid>
- <ItemsControl ItemsSource="{Binding StudioModuleLoader.UserModules}" Grid.Row="2" Margin="10">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True"></WrapPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
-
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <materialDesign:Card Width="300" Margin="10" Height="400">
- <Grid >
- <Grid.RowDefinitions>
- <RowDefinition Height="180" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Image Source="{Binding Image,Mode=OneWay}" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" />
- <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.StartModuleCommand}" CommandParameter="{Binding}" Grid.Row="0" Margin="0,0,20,-35" HorizontalAlignment="Right" Width="70" Height="70" VerticalAlignment="Bottom" Style="{StaticResource MaterialDesignFloatingActionMiniButton}" ToolTip="Start This Module">
- <materialDesign:PackIcon Kind="Play" Width="30" Height="30" />
- </Button>
- <StackPanel Grid.Row="1" Margin="8,24,8,0">
- <TextBlock FontWeight="Bold" FontSize="20" Text="{Binding Name,Mode=OneWay}"></TextBlock>
- <TextBlock VerticalAlignment="Center" Margin="0 5 0 0" FontSize="14" TextWrapping="Wrap" Text="{Binding Description,Mode=OneWay}"></TextBlock>
- </StackPanel>
- <StackPanel Grid.Row="2" Margin="8" HorizontalAlignment="Right" Orientation="Horizontal">
- <materialDesign:PopupBox Padding="2,0,2,0" Style="{StaticResource MaterialDesignToolPopupBox}">
- <StackPanel>
- <Button Content="More" />
- <Button Content="Options" />
- </StackPanel>
- </materialDesign:PopupBox>
+ <controls:MultiTransitionControl x:Name="TransitionControl" AlwaysFade="True" TransitionType="Zoom">
+ <controls:MultiTransitionControl.Controls>
+ <ContentControl Tag="Home">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="150"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+ <Grid>
+ <StackPanel Margin="30 20" HorizontalAlignment="Left">
+ <TextBlock Style="{StaticResource MaterialDesignDisplay1TextBlock}">Welcome to Machine Studio</TextBlock>
+ <TextBlock HorizontalAlignment="Right" Margin="0 5 -130 0" FontStyle="Italic" Style="{StaticResource MaterialDesignSubheadingTextBlock}" Foreground="{StaticResource AccentColorBrush}">Select Your Studio Module...</TextBlock>
</StackPanel>
</Grid>
- </materialDesign:Card>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- <Grid Grid.Row="1" RenderTransformOrigin="0.5,0.5">
- <Grid.Style>
- <Style TargetType="Grid">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <ScaleTransform ScaleX="0" ScaleY="0"></ScaleTransform>
- </Setter.Value>
- </Setter>
- <Setter Property="Opacity" Value="0"></Setter>
+ <Grid Grid.Row="2">
+ <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
+ <ItemsControl ItemsSource="{Binding StudioModuleLoader.UserModules}" Margin="10">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <WrapPanel IsItemsHost="True"></WrapPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsModuleLoaded}" Value="False">
- <DataTrigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.5"></DoubleAnimation>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.5"></DoubleAnimation>
- <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.5"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.5"></DoubleAnimation>
- <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.5"></DoubleAnimation>
- <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.5"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Grid.Style>
- <ContentPresenter Content="{Binding CurrentModule.MainView}"/>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <materialDesign:Card Width="300" Margin="10" Height="400">
+ <Grid >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="180" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <Image Source="{Binding Image,Mode=OneWay}" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" />
+ <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.StartModuleCommand}" CommandParameter="{Binding}" Grid.Row="0" Margin="0,0,20,-35" HorizontalAlignment="Right" Width="70" Height="70" VerticalAlignment="Bottom" Style="{StaticResource MaterialDesignFloatingActionMiniButton}" ToolTip="Start This Module">
+ <materialDesign:PackIcon Kind="Play" Width="30" Height="30" />
+ </Button>
+ <StackPanel Grid.Row="1" Margin="8,24,8,0">
+ <TextBlock FontWeight="Bold" FontSize="20" Text="{Binding Name,Mode=OneWay}"></TextBlock>
+ <TextBlock VerticalAlignment="Center" Margin="0 5 0 0" FontSize="14" TextWrapping="Wrap" Text="{Binding Description,Mode=OneWay}"></TextBlock>
+ </StackPanel>
+ <StackPanel Grid.Row="2" Margin="8" HorizontalAlignment="Right" Orientation="Horizontal">
+ <materialDesign:PopupBox Padding="2,0,2,0" Style="{StaticResource MaterialDesignToolPopupBox}">
+ <StackPanel>
+ <Button Content="More" />
+ <Button Content="Options" />
+ </StackPanel>
+ </materialDesign:PopupBox>
+ </StackPanel>
+ </Grid>
+ </materialDesign:Card>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </ScrollViewer>
+ </Grid>
+ </Grid>
+ </ContentControl>
+ </controls:MultiTransitionControl.Controls>
+ </controls:MultiTransitionControl>
</Grid>
</Grid>
@@ -289,7 +290,7 @@
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="20 0 0 0">
<mahapps:ProgressRing Width="24" Height="24" Foreground="White"></mahapps:ProgressRing>
- <TextBlock Text="{Binding NotificationProvider.CurrentTaskItem.Message}" Foreground="White" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock>
+ <TextBlock Text="{Binding NotificationProvider.CurrentTaskItem.Message,Converter={StaticResource StringEllipsisConverter},ConverterParameter=35}" Foreground="White" VerticalAlignment="Center" Margin="10 0 0 0" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</Border>
</Grid>
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 f52393e1c..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
@@ -14,11 +14,17 @@ using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.MachineStudio.Common.Modules;
using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.UI.Modules;
using Tango.MachineStudio.UI.Notifications;
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
{
@@ -27,9 +33,63 @@ namespace Tango.MachineStudio.UI.Views
/// </summary>
public partial class MainView : View, IMainView
{
+ private DefaultStudioModuleLoader _loader;
+
public MainView() : base()
{
InitializeComponent();
+
+ _loader = ServiceLocator.Current.GetInstance<IStudioModuleLoader>() as DefaultStudioModuleLoader;
+ _loader.ModulesLoaded += Loader_ModulesLoaded;
+ }
+
+ public void NavigateToModule(IStudioModule module)
+ {
+ TransitionControl.AutoNavigate(module != null ? module.Name : "Home");
+ }
+
+ private void Loader_ModulesLoaded(object sender, EventArgs e)
+ {
+ TransitionControl.Controls.RemoveAll((x) => x.Tag.ToString() != "Home");
+
+ Task.Factory.StartNew(() =>
+ {
+ 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(() =>
+ {
+ TransitionControl.RefreshControls();
+ });
+
+ item.Pop();
+ });
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml
index 487dfe1f8..dd86238ce 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ShutdownView.xaml
@@ -6,7 +6,7 @@
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
- d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" Background="White" DataContext="{Binding ShutdownViewVM, Source={StaticResource Locator}}">
+ d:DesignHeight="720" d:DesignWidth="1280" Cursor="Wait" Background="Transparent" DataContext="{Binding ShutdownViewVM, Source={StaticResource Locator}}">
<Grid>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel>