-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
114 lines (110 loc) · 6.47 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
<Window x:Class="MarlinEasyConfig.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:local="clr-namespace:MarlinEasyConfig"
mc:Ignorable="d"
Title="MarlinEasyConfig" Height="700" MinHeight="115" Width="1000" MinWidth="620">
<DockPanel>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Menu Height="22" Grid.Column="0">
<MenuItem Header="Menu" VerticalAlignment="Stretch" Height="22">
<MenuItem Header="_Open Marlin Folder" Click="Menu_OpenMarlin"/>
<Separator />
<MenuItem Header="_Compare Marlin Configuration" Click="Menu_OpenMarlin" Name="MenuItem_Compare" IsEnabled="False"/>
<MenuItem Header="_Transfer Compared Values" Click="Menu_Transfer" Name="MenuItem_Transfer" IsEnabled="False"/>
<MenuItem Header="_Restore Configuration" Click="Menu_Restore" Name="MenuItem_Restore" IsEnabled="False"/>
<Separator />
<MenuItem Header="_Save Config" Click="MenuItem_Save"/>
<Separator />
<MenuItem Header="_Exit" Click="Menu_Exit"/>
</MenuItem>
<MenuItem Header="_Info" Click="MenuItem_Info"/>
</Menu>
<Label Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,220,0" Content="Search Name:"></Label>
<TextBox Grid.Column="1" Text="" Name="Input_Search" HorizontalAlignment="Right" Margin="0,0,20,0" TextWrapping="Wrap" Width="200" Height="22" TextChanged="Input_Search_TextChanged" />
</Grid>
<DataGrid Name="ConfigTable" DockPanel.Dock="Bottom" AutoGenerateColumns="False" CanUserSortColumns="False" CellEditEnding="ConfigTable_CellEditEnding" ContextMenuOpening="ConfigTable_ContextMenuOpening">
<DataGrid.ContextMenu>
<ContextMenu>
<MenuItem Header="Copy Name" Name="ContextCopy" />
<MenuItem Header="Paste Name" Name="ContextPaste" />
</ContextMenu>
</DataGrid.ContextMenu>
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" IsReadOnly="True" Width="Auto" MinWidth="200">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#759cd3" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Value" Binding="{Binding Value}" Width="*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="{Binding TypeBrush}" />
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Foreground" Value="{Binding TypeBrush}" />
<Setter Property="Background" Value="{Binding ComparisonBrush}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Compared Value" x:Name="CompareColumn" Binding="{Binding DifferentValue}" Width="*" IsReadOnly="True">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="{Binding TypeBrush}" />
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Foreground" Value="{Binding TypeBrush}" />
<Setter Property="Background" Value="{Binding ComparisonBrush}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Comment" Binding="{Binding Comment}" IsReadOnly="True" Width="*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#689f24" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsFiltered}" Value="true">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Padding" Value="3"/>
<Setter Property="Background" Value="{Binding ComparisonBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.CellStyle>
</DataGrid>
</DockPanel>
</Window>