-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathMainWindow.xaml
118 lines (107 loc) · 7.93 KB
/
MainWindow.xaml
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
<controls:MetroWindow x:Name="MainWindow1" x:Class="Capture.Workflow.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:viewModel="clr-namespace:Capture.Workflow.ViewModel"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Capture.Workflow.Wpf.Converters"
mc:Ignorable="d"
Title="Workflow Manager" Height="600" Width="800" WindowStartupLocation="CenterScreen" PreviewKeyDown="MetroWindow_PreviewKeyDown">
<Window.DataContext>
<viewModel:MainWindowViewModel/>
</Window.DataContext>
<Window.Resources>
<converters:WorkflowToCardBitmapConverter x:Key="WorkflowToCardBitmapConverter" />
</Window.Resources>
<materialDesign:DialogHost Identifier="RootDialog" Focusable="False" >
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}">
<materialDesign:DrawerHost.LeftDrawerContent>
<DockPanel MinWidth="212">
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}"
DockPanel.Dock="Top"
HorizontalAlignment="Right" Margin="16"
IsChecked="{Binding ElementName=MenuToggleButton, Path=IsChecked, Mode=TwoWay}" />
<StackPanel>
<!--<MenuItem Header="New"/>
<MenuItem Header="Open ..." Command="{Binding LoadCommand}"/>
<MenuItem Header="Save ..." Command="{Binding SaveCommand}"/>-->
</StackPanel>
</DockPanel>
</materialDesign:DrawerHost.LeftDrawerContent>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="421*"/>
</Grid.RowDefinitions>
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2"
Mode="PrimaryMid" DockPanel.Dock="Top" Height="69">
<DockPanel>
<ToggleButton Style="{StaticResource MaterialDesignHamburgerToggleButton}" IsChecked="False"
x:Name="MenuToggleButton"/>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<Label VerticalAlignment="Center" Content="{Binding QueueManager.Count}" ToolTip="{Binding QueueManager.ErrorMessage}"/>
<materialDesign:PopupBox PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
<StackPanel>
<Button Content="Create New Workflow" Command="{Binding NewCommand}"/>
<Separator/>
<Button Content="Locate log file" Command="{Binding LocateLogCommand}"/>
<Button Content="Clear Queue Database" Command="{Binding ClearQueueCommand}"/>
<Separator/>
<Button Content="Settings" Command="{Binding SettingsCommand}"/>
<Separator/>
<Button Content="Forum" Command="{Binding ForumCommand}"/>
<Button Content="Help" Command="{Binding HelpCommand}"/>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22">Workflows</TextBlock>
</DockPanel>
</materialDesign:ColorZone>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding WorkFlows}" >
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<materialDesign:Card Margin="4" Width="280" Height="360">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="240" />
<RowDefinition Height="*" />
<!--<RowDefinition Height="80" />-->
</Grid.RowDefinitions>
<Image Stretch="Fill" Source="Images/camera.png" />
<Image Source="{Binding Path=Workflow,Converter={StaticResource WorkflowToCardBitmapConverter}}" Stretch="Fill" />
<Button Grid.Row="0" Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="0 0 16 -20" Command="{Binding ElementName=MainWindow1,Path=DataContext.RunCommand}" CommandParameter="{Binding}">
<materialDesign:PackIcon Kind="Play" Height="25" Width="25"/>
</Button>
<StackPanel Grid.Row="1" Margin="8 8 8 0" VerticalAlignment="Top">
<TextBlock FontWeight="Bold" Text="{Binding Workflow.Name}" FontSize="15"/>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Center" Text="{Binding Workflow.Description}"/>
</StackPanel>
<StackPanel HorizontalAlignment="Right" Grid.Row="1" Orientation="Horizontal" Margin="8" VerticalAlignment="Bottom">
<materialDesign:PopupBox Style="{StaticResource MaterialDesignToolPopupBox}" Padding="2 0 2 0">
<StackPanel>
<Button Content="Edit" IsEnabled="{Binding IsEditable}" Command="{Binding ElementName=MainWindow1,Path=DataContext.EditCommand}" CommandParameter="{Binding}"/>
<Button Content="Revert" IsEnabled="{Binding IsRevertable}" Command="{Binding ElementName=MainWindow1,Path=DataContext.RevertCommand}" CommandParameter="{Binding}"/>
<Button Content="Make a copy " IsEnabled="{Binding IsEditable}" Command="{Binding ElementName=MainWindow1,Path=DataContext.CopyCommand}" CommandParameter="{Binding}"/>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
</Grid>
</materialDesign:Card>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</materialDesign:DrawerHost>
</materialDesign:DialogHost>
</controls:MetroWindow>