-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathFormatOptionsWindow.axaml
More file actions
121 lines (119 loc) · 6.79 KB
/
FormatOptionsWindow.axaml
File metadata and controls
121 lines (119 loc) · 6.79 KB
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
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dialogs="using:PlanViewer.App.Dialogs"
x:Class="PlanViewer.App.Dialogs.FormatOptionsWindow"
Title="SQL Format Options"
Width="650" Height="580"
MinWidth="520" MinHeight="400"
Background="{DynamicResource BackgroundBrush}"
Foreground="{DynamicResource ForegroundBrush}"
WindowStartupLocation="CenterOwner">
<Window.Styles>
<Style Selector="ToggleSwitch">
<Setter Property="OnContent" Value=""/>
<Setter Property="OffContent" Value=""/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="RenderTransformOrigin" Value="0%,50%"/>
<Setter Property="RenderTransform" Value="scale(0.75)"/>
</Style>
<Style Selector="ToggleSwitch:checked /template/ Border#SwitchKnobBounds">
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
</Style>
<Style Selector="ToggleSwitch:checked /template/ Border#OuterBorder">
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
</Style>
</Window.Styles>
<Grid RowDefinitions="*,Auto" Margin="12">
<DataGrid x:Name="OptionsGrid" Grid.Row="0"
x:DataType="dialogs:FormatOptionRow"
AutoGenerateColumns="False"
CanUserReorderColumns="False"
CanUserSortColumns="False"
HeadersVisibility="Column"
GridLinesVisibility="Horizontal"
IsReadOnly="False"
Background="{DynamicResource BackgroundBrush}"
Foreground="{DynamicResource ForegroundBrush}"
Margin="0,0,0,12">
<DataGrid.Columns>
<DataGridTextColumn Header="Parameter" Binding="{Binding Name}" IsReadOnly="True" Width="2*"/>
<DataGridTemplateColumn Header="Current Value" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="dialogs:FormatOptionRow">
<Panel>
<ToggleSwitch IsChecked="{Binding BoolValue}"
IsVisible="{Binding IsBool}"
VerticalAlignment="Center"
Margin="4,0"/>
<ComboBox ItemsSource="{Binding ChoiceOptions}"
SelectedItem="{Binding CurrentValue}"
IsVisible="{Binding IsChoice}"
VerticalAlignment="Center"
MinHeight="0" Height="26" FontSize="12"
Margin="4,0"/>
<TextBlock Text="{Binding CurrentValue}"
IsVisible="{Binding IsText}"
VerticalAlignment="Center"
Margin="8,0"/>
</Panel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate x:DataType="dialogs:FormatOptionRow">
<Panel>
<ToggleSwitch IsChecked="{Binding BoolValue}"
IsVisible="{Binding IsBool}"
VerticalAlignment="Center"
Margin="4,0"/>
<ComboBox ItemsSource="{Binding ChoiceOptions}"
SelectedItem="{Binding CurrentValue}"
IsVisible="{Binding IsChoice}"
VerticalAlignment="Center"
MinHeight="0" Height="26" FontSize="12"
Margin="4,0"/>
<TextBox Text="{Binding CurrentValue}"
IsVisible="{Binding IsText}"
VerticalAlignment="Center"
Margin="4,0"/>
</Panel>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Default Value" IsReadOnly="True" Width="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate x:DataType="dialogs:FormatOptionRow">
<Panel>
<ToggleSwitch IsChecked="{Binding DefaultBoolValue}"
IsVisible="{Binding IsBool}"
IsEnabled="False"
VerticalAlignment="Center"
Margin="4,0"/>
<TextBlock Text="{Binding DefaultValue}"
IsVisible="{Binding !IsBool}"
VerticalAlignment="Center"
Margin="8,0"/>
<!-- Choice defaults shown as text -->
</Panel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="8">
<Button x:Name="RevertButton" Content="Revert to Default" Click="Revert_Click"
Height="32" Padding="16,0" FontSize="12"
Theme="{StaticResource AppButton}"/>
<Button x:Name="SaveButton" Content="Save" Click="Save_Click"
Height="32" Padding="16,0" FontSize="12"
Theme="{StaticResource AppButton}"/>
<Button x:Name="CloseButton" Content="Close" Click="Close_Click"
Height="32" Padding="16,0" FontSize="12"
Theme="{StaticResource AppButton}"/>
</StackPanel>
</Grid>
</Window>