aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineSetupView.xaml
blob: 40b296d1e4b1c8749114c62c32a97ac6ab84fb48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<UserControl x:Class="Tango.PPC.UI.Views.MachineSetupView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:global="clr-namespace:Tango.PPC.UI"
             xmlns:setup="clr-namespace:Tango.PPC.Common.MachineSetup;assembly=Tango.PPC.Common"
             xmlns:connectivity="clr-namespace:Tango.PPC.Common.Connectivity;assembly=Tango.PPC.Common"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:web="clr-namespace:Tango.Web;assembly=Tango.Web"
             xmlns:local="clr-namespace:Tango.PPC.UI.Views"
             xmlns:common="clr-namespace:Tango.PPC.Common;assembly=Tango.PPC.Common"
             mc:Ignorable="d" 
             d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MachineSetupViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineSetupViewVM}">
    <Grid Background="{StaticResource TangoPrimaryBackgroundBrush}">
        <Grid>
            <DockPanel>

                <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 100 0 0">
                    <Image Source="/Images/package.png" Width="180" Height="180" />
                    <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" Margin="30">Machine Setup Wizard</TextBlock>
                </StackPanel>

                <Grid DockPanel.Dock="Bottom" Height="200" Background="{StaticResource TangoMidBackgroundBrush}">
                    <Border BorderThickness="0 1 0 0" BorderBrush="{StaticResource TangoGrayBrush}">
                        <TextBox x:Name="txtLog" Foreground="{StaticResource TangoGrayTextBrush}" FontSize="12" SelectionBrush="#8BB0B0B0" IsReadOnly="True" Padding="5" Background="Transparent" AcceptsReturn="True" TextWrapping="Wrap" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">

                        </TextBox>
                    </Border>
                </Grid>

                <controls:NavigationControl x:Name="navigationControl" TransitionType="Slide" KeepElementsAttached="True" Margin="0 20 0 0" SelectedIndex="0">

                    <Grid controls:NavigationControl.NavigationName="WelcomeView">
                        <StackPanel HorizontalAlignment="Center" Margin="0 20 0 0">
                            <TextBlock TextAlignment="Center" LineHeight="40" Margin="20 0" TextWrapping="Wrap" FontSize="{StaticResource TangoTitleFontSize}">
                                <Run>Welcome to the machine setup wizard!</Run>
                                <Run>In the next steps the software will gather required information, perform tests and apply an initial configuration to this machine.</Run>
                                <LineBreak/>
                                <LineBreak/>
                                <Run>Press 'start' to initiate the setup process.</Run>
                            </TextBlock>

                            <touch:TouchButton Margin="0 250 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding NavigateToWiFiCommand}">START</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="WiFiSelectionView">
                        <DockPanel>
                            <TextBlock DockPanel.Dock="Top" Margin="20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center">
                                <Run>We need an active internet connection in order to fetch the latest software package and machine configuration.</Run>
                                <LineBreak/>
                                <LineBreak/>
                                <Run>Please connect to one of the available WiFi networks.</Run>
                            </TextBlock>

                            <connectivity:AvailableWiFiConnectionsControl DataContext="{Binding ConnectivityProvider}" Margin="50 100 50 20" BorderBrush="{StaticResource TangoDividerBrush}" BorderThickness="0 1 0 0" />
                        </DockPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="WiFiTestView">
                        <StackPanel HorizontalAlignment="Center" Margin="0 200 0 0">
                            <TextBlock DockPanel.Dock="Top" Margin="20 0" FontSize="{StaticResource TangoTitleFontSize}" HorizontalAlignment="Center"  TextWrapping="Wrap" TextAlignment="Center">
                                Checking internet connection, please wait...
                            </TextBlock>
                            <touch:TouchBusyIndicator Width="250" Margin="0 100 0 0" Height="250" IsIndeterminate="{Binding CurrentView,Converter={StaticResource EnumToBooleanConverter},ConverterParameter='WiFiTestView'}" />
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="TimeZoneView">
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500">

                            <Image Source="/Images/time-zone.png" Width="128" />
                            <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine time zone</TextBlock>
                            <touch:TouchComboBox Margin="0 80 0 0" ItemsSource="{Binding TimeZones}" SelectedItem="{Binding SelectedTimeZone,Mode=TwoWay}">
                                
                            </touch:TouchComboBox>

                            <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding TimeZoneSelectedCommand}">CONTINUE</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="EnvironmentView">
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="500">

                            <Image Source="/Images/environment.png" Width="128" />
                            <TextBlock Margin="0 20 0 0" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Please select the machine working environment</TextBlock>
                            <touch:TouchComboBox Margin="0 80 0 0" Title="Select Environment" ItemsSource="{Binding Source={x:Type web:DeploymentSlot},Converter={StaticResource EnumToItemsSourceConverter},ConverterParameter='false'}" SelectedItem="{Binding DeploymentSlot}">
                                <touch:TouchComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Padding="10" FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}">
                                            <TextBlock.Style>
                                                <Style TargetType="TextBlock">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True">
                                                            <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </TextBlock.Style>
                                        </TextBlock>
                                    </DataTemplate>
                                </touch:TouchComboBox.ItemTemplate>
                                <touch:TouchComboBox.SelectedItemTemplate>
                                    <DataTemplate>
                                        <TextBlock FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
                                    </DataTemplate>
                                </touch:TouchComboBox.SelectedItemTemplate>
                            </touch:TouchComboBox>

                            <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding EnvironmentSelectedCommand}">CONTINUE</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupWelcomeView">
                        <StackPanel>
                            <TextBlock TextAlignment="Center" LineHeight="40" FontSize="{StaticResource TangoTitleFontSize}" Margin="40 0" TextWrapping="Wrap">
                                The next step is to download the latest software package and synchronize the machine data. Please enter your machine serial number and press 'install'.
                            </TextBlock>

                            <StackPanel Width="500" Margin="0 100 0 0" TextElement.FontSize="{StaticResource TangoTitleFontSize}">
                                <TextBlock>SERIAL NUMBER</TextBlock>
                                <touch:TouchTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 10 0 0" Text="{Binding SerialNumber}" KeyboardContainer="{Binding ElementName=Container}" />

                                <StackPanel HorizontalAlignment="Center">
                                    <TextBlock Margin="0 80 0 0" FontSize="12" Foreground="{StaticResource TangoGrayTextBrush}">MACHINE SERVICE ADDRESS</TextBlock>
                                    <TextBlock FontSize="11" HorizontalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Margin="0 5 0 0" Text="{Binding HostAddress}" />
                                </StackPanel>

                                <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding InstallCommand}">INSTALL</touch:TouchButton>
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupProgressView">
                        <StackPanel>
                            <TextBlock TextAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">
                    <Run>Please wait while we're setting up this machine.</Run>
                    <Run>Do not turn off this PC.</Run>
                            </TextBlock>
                            <StackPanel Margin="0 200 0 0">
                                <TextBlock Text="{Binding MachineSetupManager.Status.Name,FallbackValue='Download Software Package'}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
                                <TextBlock HorizontalAlignment="Center" Text="{Binding MachineSetupManager.Status.Message,FallbackValue='Connecting to machine service...'}" Margin="0 40 0 0"></TextBlock>
                                <touch:TouchProgressBar Margin="50 10" Height="10" IsIndeterminate="{Binding MachineSetupManager.Status.IsIntermediate}" Maximum="{Binding MachineSetupManager.Status.Total}" Value="{Binding MachineSetupManager.Status.Progress,Mode=OneWay}" />
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupCompletedView">
                        <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0">
                            <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" />
                            <TextBlock VerticalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}">Setup completed successfully. Machine is ready!</TextBlock>

                            <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                    <Grid controls:NavigationControl.NavigationName="SetupFailedView">
                        <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0">
                            <touch:TouchIcon Icon="AlertOutline" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" />
                            <TextBlock HorizontalAlignment="Center" Margin="0 10 0 0"  FontSize="{StaticResource TangoTitleFontSize}">Setup Failed</TextBlock>
                            <TextBlock HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" Margin="30 5 30 0" Foreground="{StaticResource TangoErrorBrush}" Text="{Binding FailedError,FallbackValue='Unexpected error'}"></TextBlock>
                            <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0">Tap 'RESTART' to restart the process</TextBlock>
                            <touch:TouchButton Margin="0 180 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding RestartCommand}">RESTART</touch:TouchButton>
                        </StackPanel>
                    </Grid>

                </controls:NavigationControl>
            </DockPanel>
        </Grid>
    </Grid>
</UserControl>
<DataTrigger Binding="{Binding IsSelected}" Value="False"> <Setter Property="Visibility" Value="Hidden"></Setter> </DataTrigger> </Style.Triggers> </Style> </Border.Style> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="1*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <editors:ElementsEditor x:Name="editor" Elements="{Binding Elements}" Loaded="Editor_Loaded" ElementCreation="ElementsEditor_ElementCreation" ElementsRemoved="ElementsEditor_ElementsRemoved" AfterPaste="ElementsEditor_AfterPaste" RulerHeight="32" EditorWidth="1920" EditorHeight="1080" FontSize="10" Background="{StaticResource TransparentBackgroundBrush450}" EditorBackground="{StaticResource TransparentBackgroundBrush600}" RulerBackground="Transparent" Foreground="{StaticResource BlueSelectionStrokBrush}" SelectionFillBrush="{StaticResource SelectionFillBrush}" SelectionStrokeBrush="{StaticResource BlueSelectionStrokBrush}" BorderBrush="{StaticResource BlueSelectionStrokBrush}" BorderThickness="1"> <editors:ElementsEditor.Style> <Style TargetType="editors:ElementsEditor"> <Setter Property="IsEditable" Value="True"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=listMode,Path=SelectedIndex}" Value="1"> <Setter Property="IsEditable" Value="False"></Setter> </DataTrigger> </Style.Triggers> </Style> </editors:ElementsEditor.Style> <editors:ElementsEditor.ContextMenu> <ContextMenu DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"> <MenuItem Header="Cut (Ctrl+X)" Command="{Binding CutCommand}" MinWidth="210"> <MenuItem.Icon> <fa:ImageAwesome Icon="Cut" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Copy (Ctrl+C)" Command="{Binding CopyCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Copy" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Paste (Ctrl+V)" Command="{Binding PasteCommand}" > <MenuItem.Icon> <fa:ImageAwesome Icon="Paste" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding UndoCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Undo" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding RedoCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="RotateRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Delete (DELETE)" Command="{Binding DeleteCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Recycle" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectAllCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Th" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </editors:ElementsEditor.ContextMenu> </editors:ElementsEditor> <Slider Grid.Column="1" Orientation="Vertical" Margin="5" Maximum="3" Minimum="0.2" Value="{Binding ElementName=editor,Path=ScaleFactor}"></Slider> </Grid> </Border> </DataTemplate> </UserControl.Resources> <Grid> <Grid> <Grid.RowDefinitions> <RowDefinition Height="150"/> <RowDefinition Height="199*"/> </Grid.RowDefinitions> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <Menu Padding="5" Background="{StaticResource WhiteBrush100}" Visibility="{Binding HideMenu,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <MenuItem Header="File"> <MenuItem Command="{Binding NewProjectCommand}" MinWidth="180" Header="New" VerticalContentAlignment="Center"> <MenuItem.Icon> <fa:ImageAwesome Icon="File" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Command="{Binding OpenProjectCommand}" MinWidth="180" Header="Open" VerticalContentAlignment="Center"> <MenuItem.Icon> <fa:ImageAwesome Icon="FolderOpen" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem MinWidth="180" Header="Import" VerticalContentAlignment="Center"> <MenuItem.Icon> <fa:ImageAwesome Icon="ArrowRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> <MenuItem Header="Import Project Tabs" VerticalContentAlignment="Center" Command="{Binding ImportProjectTabsCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Table" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <Separator/> <MenuItem Header="Save" Command="{Binding SaveProjectCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Save" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Save as" Command="{Binding SaveAsProjectCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Save" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="Edit"> <MenuItem Header="Cut (Ctrl+X)" Command="{Binding SelectedTab.Editor.CutCommand}" MinWidth="210"> <MenuItem.Icon> <fa:ImageAwesome Icon="Cut" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Copy (Ctrl+C)" Command="{Binding SelectedTab.Editor.CopyCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Copy" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Paste (Ctrl+V)" Command="{Binding SelectedTab.Editor.PasteCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Paste" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Undo (Ctrl+Z)" Command="{Binding SelectedTab.Editor.UndoCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Undo" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Redo (Ctrl+Y)" Command="{Binding SelectedTab.Editor.RedoCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="RotateRight" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Delete (DELETE)" Command="{Binding SelectedTab.Editor.DeleteCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Recycle" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Select All (Ctrl+A)" Command="{Binding SelectedTab.Editor.SelectAllCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Th" Width="16" Foreground="{StaticResource MainWindow.Foreground}" /> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="View"> <MenuItem Header="Zoom In" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="0.1"> <MenuItem.Icon> <fa:ImageAwesome Icon="SearchPlus" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Zoom Out" Command="{Binding SelectedTab.Editor.ZoomCommand}" CommandParameter="-0.1"> <MenuItem.Icon> <fa:ImageAwesome Icon="SearchMinus" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <Separator/> <MenuItem Header="Reset Zoom" Command="{Binding SelectedTab.Editor.ResetZoomCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Search" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="Tools"> <MenuItem Header="Upload partial hardware configuration" Command="{Binding UploadPartialHardwareConfigurationCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Upload" Width="16" Foreground="{StaticResource MainWindow.Foreground}"/> </MenuItem.Icon> </MenuItem> <MenuItem Header="Reset all graphs" Command="{Binding ResetGraphsCommand}"> <MenuItem.Icon> <fa:ImageAwesome Icon="Refresh" Width="16" Foreground="{StaticResource MainWindow.Foreground}" /> </MenuItem.Icon> </MenuItem> </MenuItem> <MenuItem Header="Components"> <MenuItem.ItemContainerStyle> <Style TargetType="MenuItem" BasedOn="{x:Null}"> <Setter Property="Background" Value="Transparent"></Setter> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Transparent"></Setter> </Trigger> </Style.Triggers> </Style> </MenuItem.ItemContainerStyle> <ListBox Margin="-27 0 -22 0" MinWidth="180" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding AvailableTechItems}" SelectedItem="{Binding SelectedTechItem}" HorizontalContentAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Border Width="24" Height="24" BorderThickness="1" CornerRadius="100"> <Border.Style> <Style TargetType="Border"> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> <Setter Property="BorderThickness" Value="1"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> <Setter Property="Background" Value="{StaticResource WhiteBackgroundBrush}"></Setter> <Setter Property="BorderBrush" Value="{StaticResource RedBrush300}"></Setter> <Setter Property="BorderThickness" Value="2"></Setter> </DataTrigger> </Style.Triggers> </Style> </Border.Style> <Image Source="{Binding Image}" RenderOptions.BitmapScalingMode="Fant"></Image> </Border> <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Name}"></TextBlock> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </MenuItem> </Menu> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 5 10" Height="40"> <Button Height="Auto" Margin="0 0 10 0" FontSize="12" Command="{Binding ResetHardwareConfigurationCommand}" ToolTip="Reset all visual elements to the hardware configuration defined for the current machine"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Margin="0 0 2 0" Width="24" Height="24" Kind="Refresh"/> <TextBlock VerticalAlignment="Center">RESET</TextBlock> </StackPanel> </Button> <Button Height="Auto" Margin="0 0 10 0" FontSize="12" Command="{Binding SyncHardwareConfigurationCommand}" IsEnabled="{Binding ApplicationManager.IsMachineConnected}" ToolTip="Sync all visual elements to the current hardware configuration stored on the machine (last uploaded)"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Margin="0 0 0 0" Width="24" Height="24" Kind="ArrowDownBold"/> <TextBlock VerticalAlignment="Center">SYNC HW CONFIG</TextBlock> </StackPanel> </Button> <Button Height="Auto" FontSize="12" Command="{Binding UploadHardwareConfigurationCommand}" IsEnabled="{Binding ApplicationManager.IsMachineConnected}" ToolTip="Create a hardware configuration from the visual elements and upload that configuration"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center">UPLOAD HW CONFIG</TextBlock> <materialDesign:PackIcon Margin="10 0 0 0" Width="24" Height="24" Kind="ArrowRightBold"/> </StackPanel> </Button> </StackPanel> <Grid Grid.Row="1"> <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="20 0 0 0"> <ListBox ItemContainerStyle="{StaticResource basicListBoxItem}" ItemsSource="{Binding AvailableTechItems}" SelectedItem="{Binding SelectedTechItem,Mode=TwoWay}" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"></StackPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate DataType="{x:Type techItems:TechItem}"> <Border Cursor="Hand" ToolTip="{Binding Description}" RenderTransformOrigin="0.5,0.5" Width="52" Height="52" Padding="10" Margin="5" BorderThickness="1" CornerRadius="100"> <Border.Style> <Style TargetType="Border"> <Setter Property="RenderTransform"> <Setter.Value> <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> </Setter.Value> </Setter> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter> <Setter Property="BorderThickness" Value="1"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> <Setter Property="Background" Value="{StaticResource WhiteBackgroundBrush}"></Setter> <Setter Property="BorderBrush" Value="{StaticResource RedBrush300}"></Setter> <Setter Property="BorderThickness" Value="2"></Setter> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.1" Duration="00:00:0.2"></DoubleAnimation> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.1" Duration="00:00:0.2"></DoubleAnimation> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> <DataTrigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> </Storyboard> </BeginStoryboard> </DataTrigger.ExitActions> </DataTrigger> </Style.Triggers> </Style> </Border.Style> <Image Source="{Binding Image}" RenderOptions.BitmapScalingMode="Fant"></Image> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Margin="0 0 335 10" VerticalAlignment="Bottom"> <ListBox x:Name="listMode" SelectedIndex="0" Style="{StaticResource MaterialDesignToolToggleListBox}"> <ListBoxItem Height="40" Width="60" HorizontalContentAlignment="Center" ToolTip="Edit Mode"> <materialDesign:PackIcon HorizontalAlignment="Center" Width="30" Height="30" Kind="Pencil" /> </ListBoxItem> <ListBoxItem Height="40" Width="60" HorizontalContentAlignment="Center" ToolTip="Action Mode" MouseUp="OnActionModeClicked"> <materialDesign:PackIcon HorizontalAlignment="Center" Width="30" Height="30" Kind="HandPointingRight" /> </ListBoxItem> </ListBox> </StackPanel> </Grid> </Grid> <Grid Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Margin="35 0 0 0"> <ListBox Style="{x:Null}" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ItemContainerStyle="{StaticResource basicListBoxItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Tabs}" SelectedItem="{Binding SelectedTab}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel HorizontalAlignment="Left" Orientation="Horizontal"></StackPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Border Padding="5 5" Width="160" CornerRadius="10 10 0 0" Margin="1 0" Tag="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}"> <Border.ContextMenu> <ContextMenu DataContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"> <MenuItem Header="Rename" Command="{Binding RenameTabCommand}" MinWidth="210"> <MenuItem.Icon> <fa:ImageAwesome Icon="Pencil" Width="16" /> </MenuItem.Icon> </MenuItem> </ContextMenu> </Border.ContextMenu> <Border.Style> <Style TargetType="Border"> <Setter Property="Background" Value="{StaticResource LightGrayBrush150}"></Setter> <Setter Property="TextElement.Foreground" Value="{StaticResource DarkGrayBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected}" Value="True"> <Setter Property="Background" Value="{StaticResource AccentColorBrush}"></Setter> <Setter Property="TextElement.Foreground" Value="{StaticResource WhiteTextBrush}"></Setter> </DataTrigger> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Opacity" Value="0.8"></Setter> </Trigger> </Style.Triggers> </Style> </Border.Style> <DockPanel VerticalAlignment="Center"> <Button Cursor="Hand" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveTabCommand}" CommandParameter="{Binding}" DockPanel.Dock="Right" Margin="5 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="2" Height="Auto"> <materialDesign:PackIcon Kind="Close"> <materialDesign:PackIcon.Style> <Style TargetType="materialDesign:PackIcon"> <Setter Property="Foreground" Value="{StaticResource DarkGrayBrush}"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected}" Value="True"> <Setter Property="Foreground" Value="{StaticResource WhiteTextBrush}"></Setter> </DataTrigger> </Style.Triggers> </Style> </materialDesign:PackIcon.Style> </materialDesign:PackIcon> </Button> <TextBlock Text="{Binding Name}" VerticalAlignment="Center" TextAlignment="Center" TextTrimming="CharacterEllipsis" FontSize="11"></TextBlock> </DockPanel> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Button Margin="10 0 0 0" Style="{StaticResource MaterialDesignFlatButton}" Padding="2" Height="24" Cursor="Hand" Command="{Binding AddTabCommand}" ToolTip="New tab"> <materialDesign:PackIcon Width="20" Height="20" Kind="Plus" Foreground="{StaticResource AccentColorBrush}" /> </Button> </StackPanel> <Grid Margin="5 0 5 5" Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="1*"/> <ColumnDefinition Width="300"/> </Grid.ColumnDefinitions> <ItemsControl ItemsSource="{Binding Tabs}" ItemTemplate="{StaticResource TabTemplate}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> <Grid Grid.Column="1"> <DockPanel> <TextBlock DockPanel.Dock="Top" Margin="0 -30 0 0" Text="{Binding SelectedTab.Editor.SelectedElement.HostedElement.TechName}" FontSize="16" FontWeight="Bold" FontStyle="Italic"></TextBlock> <ScrollViewer VerticalScrollBarVisibility="Auto"> <StackPanel> <GroupBox DockPanel.Dock="Top" Header="BOUNDS" Padding="5"> <StackPanel> <!--Position--> <UniformGrid Columns="2" Margin="0 5 0 0"> <StackPanel Margin="0 0 5 0"> <TextBlock>Left</TextBlock> <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Left}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Top</TextBlock> <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="0" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Top}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> <!--Size--> <UniformGrid Columns="2" Margin="0 20 0 0"> <StackPanel Margin="0 0 5 0"> <TextBlock>Width</TextBlock> <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorWidth}" Value="{Binding SelectedTab.Editor.SelectedElement.Width}"></mahapps:NumericUpDown> </StackPanel> <StackPanel Margin="5 0 0 0"> <TextBlock>Height</TextBlock> <mahapps:NumericUpDown HasDecimals="False" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Margin="0 5 0 0" Minimum="10" Maximum="{Binding SelectedTab.Editor.EditorHeight}" Value="{Binding SelectedTab.Editor.SelectedElement.Height}"></mahapps:NumericUpDown> </StackPanel> </UniformGrid> <!--<Angle--> <Grid Margin="0 20 0 0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="22*"></ColumnDefinition> <ColumnDefinition Width="20*"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBlock VerticalAlignment="Center" Margin="0 0 10 0" HorizontalAlignment="Left">Angle</TextBlock> <mahapps:NumericUpDown Grid.Column="1" HorizontalContentAlignment="Center" BorderBrush="{StaticResource BorderBrushGainsboro}" Foreground="{StaticResource GrayBrush}" Maximum="360" Minimum="-360" HasDecimals="False" Margin="0 5 0 0" Value="{Binding SelectedTab.Editor.SelectedElement.Angle}"></mahapps:NumericUpDown> </Grid> <!--<Angle--> <Grid Margin="0 20 0 0"> <TextBox materialDesign:HintAssist.Hint="Custom Name" materialDesign:HintAssist.IsFloating="True" Margin="0 10 0 0" Text="{Binding SelectedTab.Editor.SelectedElement.HostedElement.CustomName,UpdateSourceTrigger=PropertyChanged}"></TextBox> </Grid> </StackPanel> </GroupBox> <ContentControl Margin="0 10 0 0" DataContext="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedTab.Editor.SelectedElement.HostedElement}" Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedTab.Editor.SelectedElement.HostedElement}"> <ContentControl.Resources> <DataTemplate DataType="{x:Type sys:Nullable}"> </DataTemplate> <DataTemplate DataType="{x:Type items:ValveItem}"> <templates:ValveTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MonitorRecorderItem}"> <templates:MonitorRecorderTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:HeaterItem}"> <templates:HeaterTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:TextItem}"> <templates:TextTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:JobRunnerItem}"> <templates:JobRunnerTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:ProcessParametersItem}"> <templates:ProcessParametersTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:BreakSensorItem}"> <templates:BreakSensorTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:BlowerItem}"> <templates:BlowerTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:SpeedSensorItem}"> <templates:SpeedSensorTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:DancerItem}"> <templates:DancerTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:WinderItem}"> <templates:WinderTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:PidItem}"> <templates:PidTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:ControllerItem}"> <templates:ControllerTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MonitorItem}"> <templates:MonitorTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:DigitalInItem}"> <templates:DigitalInTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MotorGroupItem}"> <templates:MotorGroupTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:ThreadMotionItem}"> <templates:ThreadMotionTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:DigitalOutItem}"> <templates:DigitalOutTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:DispenserItem}"> <templates:DispenserTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MotorItem}"> <templates:MotorTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MeterItem}"> <templates:MeterTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:SingleGraphItem}"> <templates:SingleGraphTemplate/> </DataTemplate> <DataTemplate DataType="{x:Type items:MultiGraphItem}"> <templates:MultiGraphTemplate/> </DataTemplate> </ContentControl.Resources> </ContentControl> </StackPanel> </ScrollViewer> </DockPanel> </Grid> </Grid> </Grid> </Grid> </Grid> </UserControl>