-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComControl.xaml
85 lines (84 loc) · 5.37 KB
/
ComControl.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
<UserControl x:Class="WellCom.ComControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WellCom"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240" MinWidth="240"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0">
<GroupBox VerticalAlignment="Top" Header="串口设置" Margin="5,5,5,0">
<StackPanel>
<DockPanel VerticalAlignment="Top">
<TextBlock Text="端口号:" Margin="10,10,0,0"></TextBlock>
<ComboBox Margin="10,10,10,0" ItemsSource="{Binding PortNameOptions,Mode=OneWay}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding PortName,Mode=TwoWay}"></ComboBox>
</DockPanel>
<DockPanel VerticalAlignment="Top">
<TextBlock Text="波特率:" Margin="10,10,0,0"></TextBlock>
<ComboBox Margin="10,10,10,0" ItemsSource="{Binding BaudRateOptions,Mode=OneWay}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding BaudRate}" ></ComboBox>
</DockPanel>
<DockPanel VerticalAlignment="Top">
<TextBlock Text="数据位:" Margin="10,10,0,0"></TextBlock>
<ComboBox Margin="10,10,10,0" ItemsSource="{Binding DataBitsOptions,Mode=OneWay}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding DataBits}" ></ComboBox>
</DockPanel>
<DockPanel VerticalAlignment="Top">
<TextBlock Text="停止位:" Margin="10,10,0,0"></TextBlock>
<ComboBox Margin="10,10,10,0" ItemsSource="{Binding StopBitOptions,Mode=OneWay}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding StopBits}"></ComboBox>
</DockPanel>
<DockPanel VerticalAlignment="Top">
<TextBlock Text="校验位:" Margin="10,10,0,0"></TextBlock>
<ComboBox Margin="10,10,10,0" ItemsSource="{Binding ParityOptions,Mode=OneWay}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectedValue="{Binding Parity}" ></ComboBox>
</DockPanel>
<!--<DockPanel VerticalAlignment="Top">
<TextBlock Height="25" Text="流控制:" Margin="10,10,0,0"></TextBlock>
<ComboBox Height="25" Margin="10,10,10,0" ></ComboBox>
</DockPanel>-->
<WrapPanel VerticalAlignment="Top" HorizontalAlignment="Center">
<CheckBox Margin="10,10,0,10">RTS</CheckBox>
<CheckBox Margin="10,10,0,10">DTR</CheckBox>
</WrapPanel>
</StackPanel>
</GroupBox>
<GroupBox VerticalAlignment="Top" Header="接收设置" Margin="5,5,5,0">
<StackPanel>
<WrapPanel VerticalAlignment="Top">
<RadioButton Width="80" Margin="10,10,10,0" IsChecked="True">HEX</RadioButton>
<RadioButton Width="80" Margin="10,10,10,0">ASCII</RadioButton>
</WrapPanel>
<WrapPanel VerticalAlignment="Top">
<CheckBox Width="80" Margin="10,10,10,10">换行显示</CheckBox>
<CheckBox Width="80" Margin="10,10,10,10">显示时间</CheckBox>
</WrapPanel>
</StackPanel>
</GroupBox>
<GroupBox VerticalAlignment="Top" Header="发送设置" Margin="5,5,5,0">
<StackPanel>
<WrapPanel VerticalAlignment="Top">
<RadioButton Width="80" Margin="10,10,10,10" IsChecked="True">HEX</RadioButton>
<RadioButton Width="80" Margin="10,10,10,10">ASCII</RadioButton>
</WrapPanel>
</StackPanel>
</GroupBox>
</StackPanel>
<GridSplitter Width="4"></GridSplitter>
<Grid Grid.Row="0" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition Height="100"></RowDefinition>
</Grid.RowDefinitions>
<RichTextBox Grid.Row="0" Grid.Column="0"></RichTextBox>
<GridSplitter Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"></GridSplitter>
<DockPanel Grid.Row="1" Grid.Column="0" MinHeight="100">
<WrapPanel Width="140" DockPanel.Dock="Right" VerticalAlignment="Center">
<Button Width="100" Height="60" Margin="20" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">发送</Button>
</WrapPanel>
<RichTextBox Width="AUTO" Height="AUTO"></RichTextBox>
</DockPanel>
</Grid>
</Grid>
</UserControl>