-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
79 lines (76 loc) · 4.22 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
<Window x:Class="XPathQuery.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="XPath Query" Width="525" Height="525" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="LabelStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="3" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Margin" Value="3" />
</Style>
<Style x:Key="ErrorTextBoxStyle" BasedOn="{StaticResource TextBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="1.2" />
</Style>
<Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Width" Value="80"/>
<Setter Property="Margin" Value="3" />
</Style>
</Window.Resources>
<DockPanel Grid.IsSharedSizeScope="True">
<StackPanel DockPanel.Dock="Top">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="ColWidth"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource LabelStyle}" Text="XML File" />
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource TextBoxStyle}" Name="txtXMLFile" TextChanged="txtXMLFile_TextChanged"
AllowDrop="True" PreviewDragEnter="txtXMLFile_PreviewDrag" PreviewDragOver="txtXMLFile_PreviewDrag" PreviewDrop="txtXMLFile_PreviewDrop" />
<TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource LabelStyle}" Text="XPath" />
<TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource TextBoxStyle}" Name="txtXPath" TextChanged="txtXPath_TextChanged" />
<TextBlock Grid.Row="2" Grid.Column="0" Style="{StaticResource LabelStyle}" Text="Namespaces">
<TextBlock.ToolTip>
For example, prefix="uri". Only one namespace per line.
</TextBlock.ToolTip>
</TextBlock>
<TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource TextBoxStyle}" MinHeight="50" AcceptsReturn="True" Name="txtNamespaces">
<TextBox.ToolTip>
For example, prefix="uri". Only one namespace per line.
</TextBox.ToolTip>
</TextBox>
<TextBlock Grid.Row="3" Grid.Column="1" Style="{StaticResource LabelStyle}" Name="txtNamespaceCount" />
</Grid>
<Button Style="{StaticResource ButtonStyle}" Content="Process" Click="Button_Click" />
</StackPanel>
<Grid DockPanel.Dock="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="ColWidth"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="1" Grid.Column="1" Style="{StaticResource LabelStyle}" Name="txtResultCount" />
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="ColWidth"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource LabelStyle}" Text="Result" />
<TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource TextBoxStyle}" IsReadOnly="True" Name="txtResult" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"/>
</Grid>
</DockPanel>
</Window>