You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
4.3 KiB
72 lines
4.3 KiB
<UserControl x:Class="MultiTerm.Wpf.View.SettingsView.SerialSettingsView"
|
|
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:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:local="clr-namespace:MultiTerm.Wpf.View.SettingsView"
|
|
xmlns:conv="clr-namespace:MultiTerm.Wpf.ValueConverters"
|
|
xmlns:serial_protocol="clr-namespace:MultiTerm.Protocols.Serial;assembly=MultiTerm.Protocols"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="50" d:DesignWidth="800">
|
|
<DockPanel>
|
|
<Button DockPanel.Dock="Left" Command="{Binding ConnectDisconnectCommand}" Content="{Binding ConnectDisconnectButtonText}" Width="80"/>
|
|
|
|
<StackPanel Orientation="Horizontal" IsEnabled="{Binding AreEditable}">
|
|
<StackPanel.Resources>
|
|
<!-- Converter -->
|
|
<conv:EnumValueToEnumDescriptionConverter x:Key="EnumValToDescConverter"/>
|
|
<conv:IntToStringConverter x:Key="IntToStringConverter"/>
|
|
|
|
<!-- Data Sources -->
|
|
<ObjectDataProvider x:Key="ParityValues"
|
|
ObjectType="{x:Type sys:Enum}"
|
|
MethodName="GetValues">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="serial_protocol:Parity" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
<ObjectDataProvider x:Key="StopBitsValues"
|
|
ObjectType="{x:Type sys:Enum}"
|
|
MethodName="GetValues">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="serial_protocol:StopBits" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
<ObjectDataProvider x:Key="HandshakeValues"
|
|
ObjectType="{x:Type sys:Enum}"
|
|
MethodName="GetValues">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="serial_protocol:Handshake" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</StackPanel.Resources>
|
|
|
|
<Label Margin="10 0" VerticalAlignment="Center">Port: </Label>
|
|
<ComboBox Width="75" ItemsSource="{Binding Path=ComPorts}" SelectedItem="{Binding Path=PortName}"/>
|
|
<Button Margin="5 0" Content="R" Command="{Binding ReloadComPortsCommand}" Width="25"/>
|
|
|
|
<Label Margin="20 0 10 0" VerticalAlignment="Center">Baud Rate:</Label>
|
|
<TextBox Width="100" Text="{Binding Path=BaudRate, Converter={StaticResource IntToStringConverter}, Mode=TwoWay}" />
|
|
|
|
<Label Margin="10 0 10 0" VerticalAlignment="Center">Data Bits:</Label>
|
|
<TextBox Width="40" Text="{Binding Path=DataBits, Converter={StaticResource IntToStringConverter}, Mode=TwoWay}" />
|
|
|
|
<Label Margin="10 0 10 0" VerticalAlignment="Center">Parity:</Label>
|
|
<ComboBox Width="60"
|
|
ItemsSource="{Binding Source={StaticResource ParityValues}, Converter={StaticResource EnumValToDescConverter}}"
|
|
SelectedItem="{Binding Path=Parity, Converter={StaticResource EnumValToDescConverter}, Mode=TwoWay}"/>
|
|
|
|
<Label Margin="10 0 10 0" VerticalAlignment="Center">Stop Bits:</Label>
|
|
<ComboBox Width="50"
|
|
ItemsSource="{Binding Source={StaticResource StopBitsValues}, Converter={StaticResource EnumValToDescConverter}}"
|
|
SelectedItem="{Binding Path=StopBits, Converter={StaticResource EnumValToDescConverter}, Mode=TwoWay}"/>
|
|
|
|
<Label Margin="10 0 10 0" VerticalAlignment="Center">Handshake:</Label>
|
|
<ComboBox Width="100"
|
|
ItemsSource="{Binding Source={StaticResource HandshakeValues}, Converter={StaticResource EnumValToDescConverter}}"
|
|
SelectedItem="{Binding Path=Handshake, Converter={StaticResource EnumValToDescConverter}, Mode=TwoWay}"/>
|
|
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</UserControl>
|
|
|