-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
91 lines (89 loc) · 3.34 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
<controls:MaterialWindow
x:Class="OneWireComm.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:OneWireComm"
xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:OneWireComm.ViewModels"
Title="OneWire Communicator"
Width="500"
Height="300"
d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowViewModel}"
Style="{StaticResource WindowStyle}"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button
Grid.Row="0"
Grid.Column="0"
Margin="8,8,8,0"
Click="InitializeClick"
Content="Initialize Touchpen"
Style="{StaticResource SmallBlueButton}" />
<Button
Grid.Row="0"
Grid.Column="1"
Margin="8,8,8,0"
Click="ReadButtonClick"
Content="Read Button"
IsEnabled="{Binding IsInitialized}"
Style="{StaticResource SmallDefaultButton}" />
<StackPanel
Grid.Row="0"
Grid.Column="2"
Margin="5"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Port:" />
<ComboBox
MinWidth="30"
Margin="5,0,5,0"
material:ComboBoxAssist.ClassicMode="True"
ItemsSource="{Binding AvailablePorts}"
SelectedItem="{Binding Port}" />
</StackPanel>
<DataGrid
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="8"
AutoGenerateColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
CanUserReorderColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
FocusVisualStyle="{x:Null}"
Focusable="False"
GridLinesVisibility="Horizontal"
IsReadOnly="True"
ItemsSource="{Binding HistoryItems}"
SelectionMode="Single"
SelectionUnit="FullRow">
<DataGrid.Columns>
<DataGridTextColumn
Width="Auto"
Binding="{Binding Path=EventTime, StringFormat='HH:mm:ss'}"
Header="Time" />
<DataGridTextColumn
Width="Auto"
Binding="{Binding Path=Serial}"
Header="Serial" />
<DataGridTextColumn
Width="Auto"
Binding="{Binding Path=Message}"
Header="Message" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</controls:MaterialWindow>