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
|
<controls:View x:Class="Tango.MachineStudio.UI.Views.MainView"
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:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz"
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
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}}">
<Grid>
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
<materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel MinWidth="212">
<Grid DockPanel.Dock="Top">
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}"
HorizontalAlignment="Right" Margin="16"
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
<StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Account" Foreground="{StaticResource AccentColorBrush}" Width="32" Height="32"></materialDesign:PackIcon>
<TextBlock Margin="10 0 0 0" VerticalAlignment="Center">User Name</TextBlock>
</StackPanel>
</Grid>
<ListBox x:Name="DemoItemsListBox" Margin="0 16 0 16" SelectedIndex="0">
<Button Command="{Binding HomeCommand}" Style="{DynamicResource MaterialDesignFlatButton}">Home</Button>
<ListBoxItem>Item 2</ListBoxItem>
<ListBoxItem>Item 3</ListBoxItem>
<ListBoxItem>Item 4</ListBoxItem>
<ListBoxItem>Item 5</ListBoxItem>
</ListBox>
</DockPanel>
</materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel>
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2"
Mode="PrimaryMid" DockPanel.Dock="Top">
<DockPanel>
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="{Binding IsMenuOpened}"
x:Name="MenuToggleButton"/>
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<StackPanel>
<Button Content="Home"/>
<Button Content="Nice Popup"/>
<Button Content="Can't Touch This" IsEnabled="False" />
<Separator/>
<Button Content="Goodbye"/>
</StackPanel>
</materialDesign:PopupBox>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Height="60" HorizontalAlignment="Center">
<Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant"></Image>
<TextBlock Text="Machine Studio" VerticalAlignment="Center" Margin="20 0 0 0" FontSize="36"/>
</StackPanel>
</DockPanel>
</materialDesign:ColorZone>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</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>
</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>
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentModule}" Value="{x:Null}">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0" Duration="00:00:0.2"></DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" 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>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<ContentPresenter Content="{Binding CurrentModule.MainView}"></ContentPresenter>
</Grid>
</Grid>
</Grid>
</DockPanel>
</materialDesign:DrawerHost>
</Grid>
</controls:View>
|