-
Notifications
You must be signed in to change notification settings - Fork 0
/
PluginView.xaml
224 lines (205 loc) · 10.7 KB
/
PluginView.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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<aml:PluginViewBase
x:Class="Aml.Editor.Plugin.BaseX.PluginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:aml="http://www.automationml.org/amlPlugin"
xmlns:amlTree="http://www.automationml.org/amlTool/"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:icons="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:Aml.Editor.Plugin.BaseX"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:view="clr-namespace:Aml.Editor.Plugin.BaseX.View"
xmlns:vm="clr-namespace:Aml.Editor.Plugin.BaseX.ViewModel"
d:DataContext="{d:DesignInstance Type=vm:PluginViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<aml:PluginViewBase.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<ResourceDictionary Source="/Aml.Skins;component/Themes/Light.Styles.xaml" />
<ResourceDictionary Source="/Aml.Toolkit;component/Themes/Generic.xaml" />
<ResourceDictionary Source="/Aml.Skins;component/Resources/Icons.xaml" />
</ResourceDictionary.MergedDictionaries>
<DrawingImage x:Key="PluginIcon" PresentationOptions:Freeze="True">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="DarkOrange" Geometry="M20 14v4a2 2 0 0 1-2 2h-4v-2a2 2 0 0 0-2-2 2 2 0 0 0-2 2v2H6a2 2 0 0 1-2-2v-4H2a2 2 0 0 1-2-2 2 2 0 0 1 2-2h2V6c0-1.1.9-2 2-2h4V2a2 2 0 0 1 2-2 2 2 0 0 1 2 2v2h4a2 2 0 0 1 2 2v4h-2a2 2 0 0 0-2 2 2 2 0 0 0 2 2h2z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
</aml:PluginViewBase.Resources>
<Grid>
<Grid.LayoutTransform>
<ScaleTransform ScaleX="{Binding ZoomFactor}" ScaleY="{Binding ZoomFactor}" />
</Grid.LayoutTransform>
<Grid.RowDefinitions>
<RowDefinition Height="32" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border
x:Name="HeaderBorder"
Grid.Row="0"
Grid.ColumnSpan="2"
Style="{DynamicResource WindowToolBarBorderStyle}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<mah:SplitButton
Margin="3,0"
Command="{Binding EditSelectedDocumentCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Text}"
Orientation="Horizontal"
SelectedIndex="1"
SelectionChanged="SplitButton_SelectionChanged"
ToolTip="Edit selected document">
<mah:SplitButton.Style>
<Style TargetType="{x:Type mah:SplitButton}">
<Setter Property="BorderThickness" Value="0" />
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsEnabled" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderThickness" Value="1" />
<!--<Setter TargetName="PART_Button" Property="BorderThickness" Value="1,1,0,1" />-->
</MultiTrigger>
</Style.Triggers>
</Style>
</mah:SplitButton.Style>
<mah:SplitButton.Icon>
<icons:Material Kind="FileEdit" />
</mah:SplitButton.Icon>
<mah:SplitButton.Items>
<TextBlock Text="Partial" />
<TextBlock Text="Complete" />
</mah:SplitButton.Items>
</mah:SplitButton>
<Grid Grid.Column="8" HorizontalAlignment="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Margin="2,0"
VerticalAlignment="Center"
Style="{DynamicResource MahApps.Styles.TextBlock}"
Text="{Binding SelectedDocument.Name, Mode=OneWay}" />
<Button
x:Name="SettingsBtn"
Grid.Column="1"
HorizontalAlignment="Right"
Click="SettingsBtn_Click"
Style="{DynamicResource MahApps.Styles.Button.ToolBar}"
ToolTip="Connect to database">
<icons:Material Kind="Database" />
</Button>
</Grid>
</Grid>
</Border>
<TabControl
Grid.Row="1"
mah:TabControlHelper.UnderlinePlacement="Bottom"
mah:TabControlHelper.Underlined="TabPanel"
Style="{StaticResource MahApps.Styles.TabControl}">
<TabItem
x:Name="DocHeader"
mah:HeaderedControlHelper.HeaderFontSize="14"
mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center"
Header="{Binding DocumentsBase}"
Style="{StaticResource MahApps.Styles.TabItem}">
<TabItem.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<ContentPresenter VerticalAlignment="Center" Content="{Binding ElementName=DocHeader, Path=Header}" />
<Button
Margin="2,0"
Command="{Binding ElementName=DocHeader, Path=DataContext.LoadDocumentsCommand}"
Style="{DynamicResource MahApps.Styles.Button.ToolBar}"
ToolTip="Reload Documentlist">
<icons:Material Width="12" Kind="Refresh" />
</Button>
</StackPanel>
</DataTemplate>
</TabItem.HeaderTemplate>
<DataGrid
x:Name="AzureDataGrid"
Margin="8,8,0,10"
AutoGenerateColumns="False"
ItemsSource="{Binding Path=Documents}"
RowHeaderWidth="0"
SelectedItem="{Binding SelectedDocument}"
Style="{DynamicResource MahApps.Styles.DataGrid.Azure}">
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding Name, Mode=OneWay}"
Header="Document"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding Size, Mode=OneWay}"
Header="Size"
IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
</TabItem>
<TabItem
x:Name="QueryHeader"
mah:HeaderedControlHelper.HeaderFontSize="14"
mah:HeaderedControlHelper.HeaderVerticalContentAlignment="Center"
Header="XQuery"
Style="{StaticResource MahApps.Styles.TabItem}">
<TabItem.HeaderTemplate>
<DataTemplate>
<ContentPresenter VerticalAlignment="Center" Content="{Binding ElementName=QueryHeader, Path=Header}" />
</DataTemplate>
</TabItem.HeaderTemplate>
<view:XQueryView x:Name="QueryView" DataContext="{Binding QueryViewModel}" >
</view:XQueryView>
</TabItem>
</TabControl>
<Border
Grid.Row="2"
Margin="0,5"
Background="{DynamicResource MahApps.Brushes.Flyout.Background}"
BorderBrush="{DynamicResource MahApps.Brushes.Flyout.Foreground}"
BorderThickness="0,1,0,0">
<mah:MetroAnimatedSingleRowTabControl mah:HeaderedControlHelper.HeaderFontSize="16">
<mah:MetroTabItem Header="Error List">
<TextBlock
Margin="10,5"
Text="{Binding Error}"
TextWrapping="Wrap" />
</mah:MetroTabItem>
<mah:MetroTabItem Header="Information">
<TextBlock Margin="10,5" TextWrapping="Wrap">
<Run>This plugin allows to connect to an AutomationML BaseX database and to transfer AutomationML model data to the AutomationML editor.</Run>
<LineBreak />
<Run>This is the first draft of the plugin. It is a current development. Progress is reported in my</Run>
<Hyperlink NavigateUri="https://josefprinz.github.io/automationml/2022/12/29/Setting-up-the-development-environment-for-AMLBaseX/" RequestNavigate="Hyperlink_RequestNavigate">
Blog
</Hyperlink>
</TextBlock>
</mah:MetroTabItem>
</mah:MetroAnimatedSingleRowTabControl>
</Border>
</Grid>
</aml:PluginViewBase>