-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainWindow.xaml
50 lines (49 loc) · 2.57 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
<Window x:Class="ChristmasClockController.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:ChristmasClockController"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid DataContext="{StaticResource MockViewModel}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="1">
<Button Content="Scan" Command="{Binding GetAvailableComPorts}" />
<ListBox ItemsSource="{Binding ComPorts}" SelectedItem="{Binding ComPort}"></ListBox>
<Button Visibility="{Binding Disconnected}" Content="Connect" Command="{Binding Connect}" />
<Button Visibility="{Binding Connected}" Content="Disconnect" Command="{Binding Disconnect}" />
<Button Visibility="{Binding ComPortSelected}" Content="BootMode" Command="{Binding BootMode}" />
</StackPanel>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<ListBox Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Console}" SelectedItem="{Binding SelectedLine}">
<ListBox.ItemTemplate>
<DataTemplate>
<local:ConsoleEntry Height="auto" DataContext="{Binding}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="0" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" Grid.Row="0" Text="{Binding ConsoleInput}" />
<Button Grid.Column="1" Grid.Row="0" Content="Send" Command="{Binding Send}"></Button>
<Button Grid.Column="2" Grid.Row="0" Content="Clear" Command="{Binding Clear}"></Button>
</Grid>
</Grid>
</Grid>
</Window>