-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
148 lines (144 loc) · 6.82 KB
/
Copy pathMainWindow.xaml
File metadata and controls
148 lines (144 loc) · 6.82 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<Window x:Class="Replacket.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:Replacket"
xmlns:viewModels="clr-namespace:Replacket.ViewModel"
xmlns:converters="clr-namespace:Replacket.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Title="Replacket"
Height="430" Width="650"
Background="{DynamicResource MaterialDesignDarkBackground}"
DataContext="{Binding Main, Source={StaticResource Locator}}"
>
<Grid>
<Grid.Resources>
<converters:ShownUrlConverter x:Key="ShownUrlConverter" />
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<GroupBox Header="Packet data"
Style="{StaticResource AlonGroupBoxStyle}"
Tag="Message">
<Grid>
<TextBlock FontSize="20"
TextWrapping="Wrap"
Text="{Binding PacketData}"/>
</Grid>
</GroupBox>
<Grid Grid.Row="1">
<ProgressBar Minimum="0"
Maximum="100"
Width="250"
Height="30"
Style="{StaticResource MaterialDesignLinearProgressBar}"
Value="{Binding Progress}"/>
<TextBlock FontSize="20"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding Progress, StringFormat={}{0:0}%}"/>
</Grid>
</Grid>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="150"/>
</Grid.RowDefinitions>
<GroupBox Style="{DynamicResource AlonGroupBoxStyle}"
Tag="Settings"
Header="Settings">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock" BasedOn="{StaticResource MaterialDesignSubtitle1TextBlock}">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="StackPanel">
<Setter Property="Orientation" Value="Horizontal"/>
</Style>
<Style TargetType="TextBox" BasedOn="{StaticResource MaterialDesignTextBox}">
<Setter Property="Height" Value="27"/>
<Setter Property="Width" Value="100"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="65"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="Device:"/>
<ComboBox Grid.Column="1"
Width="150"
FontSize="12"
HorizontalAlignment="Left"
DisplayMemberPath="Interface.FriendlyName"
ItemsSource="{Binding Devices}"
SelectedItem="{Binding SelectedDevice}"/>
<TextBlock Grid.Row="1"
Text="Time:"/>
<StackPanel Grid.Row="1"
Grid.Column="1">
<TextBox IsEnabled="{Binding CheckedNormalCheckBox, Converter={StaticResource NotConverter}}"
Text="{Binding Time}"
/>
<CheckBox IsChecked="{Binding CheckedNormalCheckBox}"/>
<TextBlock Margin="6,0,0,0"
FontSize="12"
Text="Normal"/>
</StackPanel>
<TextBlock Grid.Row="2"
Text="Repeat:"/>
<TextBox Grid.Row="2"
Grid.Column="1"
Text="{Binding Repeat}"/>
<TextBlock Grid.Row="3"
Text="File:"/>
<StackPanel Grid.Row="3"
Grid.Column="1">
<TextBox IsEnabled="False"
Text="{Binding Url, Converter={StaticResource ShownUrlConverter}}" />
<Button Margin="30,0,0,0"
Style="{StaticResource MaterialDesignFlatDarkBgButton}"
Content="Select"
Command="{Binding OpenFileDialogCommand}"/>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1"
Style="{DynamicResource AlonGroupBoxStyle}"
Header="Switch">
<UniformGrid Columns="2">
<Button Foreground="White"
BorderBrush="Green"
Background="Green"
Width="100"
IsEnabled="{Binding OnTransmit, Converter={StaticResource NotConverter}}"
Content="Start"
Command="{Binding StartTransmitCommand}"/>
<Button Foreground="White"
BorderBrush="Red"
Background="Red"
Width="100"
IsEnabled="{Binding OnTransmit}"
Content="Stop"
Command="{Binding StopTransmitCommand}"/>
</UniformGrid>
</GroupBox>
</Grid>
</Grid>
</Window>