blob: 7f1c1a115183c62a7ec377652e7cf82539271343 (
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
<UserControl x:Class="Tango.PPC.UI.Views.LayoutView"
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:local="clr-namespace:Tango.PPC.UI.Views"
xmlns:localControls="clr-namespace:Tango.PPC.UI.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters"
xmlns:operations="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}">
<UserControl.Resources>
<localConverters:NotificationItemConverter x:Key="NotificationItemConverter" />
<localConverters:AppBarItemConverter x:Key="AppBarItemConverter" />
</UserControl.Resources>
<Grid>
<touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1">
<touch:TouchSideMenu.MenuContent>
<Border x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}" TextElement.Foreground="{StaticResource TangoLightForegroundBrush}">
<DockPanel LastChildFill="False" Background="#D9151515">
<StackPanel MinWidth="300" DockPanel.Dock="Top">
<Grid>
<touch:TouchToggleButton Style="{StaticResource TangoTouchToggleButtonHamburger}"
HorizontalAlignment="Right" Margin="16"
IsChecked="{Binding ElementName=menu,Path=IsOpened}" />
<StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image>
<StackPanel Margin="0 5 0 0">
<TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName,FallbackValue='User Full Name'}"></TextBlock>
<TextBlock FontSize="12" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" Margin="10 5 0 0" VerticalAlignment="Center">
<Run Text="{Binding AuthenticationProvider.CurrentUser.Organization.Name,FallbackValue='Organization'}"></Run>
,
<Run Text="{Binding AuthenticationProvider.CurrentUser.Roles[0].Name,FallbackValue='User Roles'}">
<Run.ToolTip>
<ItemsControl ItemsSource="{Binding AuthenticationProvider.CurrentUser.Roles}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="2">
<fa:ImageAwesome Icon="User" Width="16" Height="16" />
<TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Run.ToolTip>
</Run>
<Run>...</Run>
</TextBlock>
</StackPanel>
</StackPanel>
</Grid>
<StackPanel Margin="0 16 0 0">
<touch:TouchButton Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoLightForegroundBrush}" FontWeight="Normal" Command="{Binding HomeCommand}" FontSize="{StaticResource TangoHeaderFontSize}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!--<fa:ImageAwesome VerticalAlignment="Center" Icon="Home" Width="48" Height="48"></fa:ImageAwesome>-->
<TextBlock VerticalAlignment="Center" Margin="0 0 0 0">Home</TextBlock>
</StackPanel>
</touch:TouchButton>
</StackPanel>
<ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<touch:TouchButton Margin="0 30 0 0" FontWeight="Normal" Foreground="{StaticResource TangoLightForegroundBrush}" Style="{StaticResource TangoFlatButton}" FontSize="{StaticResource TangoHeaderFontSize}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ModuleNavigationCommand}" CommandParameter="{Binding Name}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!--<Image VerticalAlignment="Center" Source="{Binding Image}" Width="48" Height="48"></Image>-->
<TextBlock VerticalAlignment="Center" Margin="0 0 0 0" Text="{Binding Name}"></TextBlock>
</StackPanel>
</touch:TouchButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<StackPanel DockPanel.Dock="Bottom">
<Separator Margin="0 10 0 0" Background="#505050" />
<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="30" Command="{Binding SignOutCommand}" FontSize="{StaticResource TangoHeaderFontSize}" Foreground="{StaticResource TangoLightForegroundBrush}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<touch:TouchIcon VerticalAlignment="Center" Angle="180" Icon="Logout" Width="32" Height="32"></touch:TouchIcon>
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Sign Out</TextBlock>
</StackPanel>
</touch:TouchButton>
</StackPanel>
</DockPanel>
</Border>
</touch:TouchSideMenu.MenuContent>
<DockPanel>
<Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" DockPanel.Dock="Top">
<DockPanel>
<Border Padding="20" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}">
<touch:TouchHamburgerButton Width="50" Command="{Binding MenuOrBackCommand}" EnableDropShadow="False" Height="50" Foreground="{StaticResource TangoPrimaryAccentBrush}" IsBack="{Binding NavigationManager.CanNavigateBack}">
<touch:TouchHamburgerButton.Effect>
<DropShadowEffect ShadowDepth="15" BlurRadius="20" Color="Silver" />
</touch:TouchHamburgerButton.Effect>
</touch:TouchHamburgerButton>
</Border>
<Grid DockPanel.Dock="Right" Margin="0 0 20 0">
<StackPanel Orientation="Horizontal">
<StackPanel VerticalAlignment="Center">
<Image Width="33" HorizontalAlignment="Center">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Standby}">
<Setter Property="Source" Value="/Images/GlobalStatus/standby.png"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.ReadyToDye}">
<Setter Property="Source" Value="/Images/GlobalStatus/ready-to-dye.png"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding MachineProvider.MachineOperator.Status}" Value="{x:Static operations:MachineStatuses.Printing}">
<Setter Property="Source" Value="/Images/GlobalStatus/dyeing.png"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
</StackPanel>
<Grid Margin="40 0 0 0">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding MachineProvider.MachineOperator.IsPrinting}" Value="True">
<Setter Property="Visibility" Value="Visible"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<touch:TouchButton Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" Command="{Binding StopPrintingCommand}">
STOP
</touch:TouchButton>
</Grid>
</StackPanel>
</Grid>
<Grid>
<Grid Margin="20 0 60 0" Height="80" Visibility="{Binding NotificationProvider.HasAppBarItem,Converter={StaticResource BooleanToVisibilityConverter}}">
<ContentControl Content="{Binding NotificationProvider.CurrentAppBarItem,Converter={StaticResource AppBarItemConverter}}"></ContentControl>
</Grid>
<!--External Header Content Here-->
<commonControls:AsyncAdornerControl>
<commonControls:AsyncAdornerControl.Style>
<Style TargetType="commonControls:AsyncAdornerControl">
<Setter Property="Visibility" Value="Hidden"></Setter>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding NotificationProvider.IsInGlobalBusyState}" Value="True" />
<Condition Binding="{Binding IsMenuOpened}" Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"></Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</commonControls:AsyncAdornerControl.Style>
<StackPanel VerticalAlignment="Center">
<touch:TouchGifAnimation Source="/Images/preloader_rectangles.gif" EnableAnimation="{Binding NotificationProvider.IsInGlobalBusyState}" />
</StackPanel>
</commonControls:AsyncAdornerControl>
</Grid>
</DockPanel>
</Border>
<Grid Background="{StaticResource TangoKeyboardBackground}">
<controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom" KeepElementsAttached="True">
<!--MODULES GOES HERE-->
</controls:NavigationControl>
</Grid>
</DockPanel>
</touch:TouchSideMenu>
</Grid>
</UserControl>
|