Sic.Framework-Nanjing-Baishi/SimulatorCore/Commons/SerialPortTitleView.xaml

66 lines
2.3 KiB
XML

<UserControl
x:Class="MECF.Framework.Simulator.Core.Commons.SerialPortTitleView"
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:local="clr-namespace:MECF.Framework.Simulator.Core.Commons"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="100"
d:DesignWidth="800"
Background="LightBlue"
mc:Ignorable="d">
<UserControl.Resources>
<local:ConnectionStatusBackgroundConverter x:Key="connectionStatusBackgroundConverter" />
<Style TargetType="Label">
<Setter Property="FontSize" Value="16" />
<Setter Property="Padding" Value="10,0,10,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Label
Grid.Row="0"
Height="50"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}"
Content="{Binding Title}"
FontSize="20" />
<StackPanel Grid.Row="1" Orientation="Horizontal">
<ComboBox
Width="120"
Height="35"
Margin="20,0,0,0"
VerticalContentAlignment="Center"
ItemsSource="{Binding PortList}"
SelectedItem="{Binding LocalPortSetPoint, Mode=TwoWay}" />
<Label Content="Port:" />
<Label Content="{Binding LocalPort}" />
<Label Content="{Binding ConnectionStatus}" />
<Button
Width="100"
Height="35"
Command="{Binding EnableCommand}"
Content="Enable"
IsEnabled="{Binding IsEnableEnable}" />
<Button
Width="100"
Height="35"
Command="{Binding DisableCommand}"
Content="Disable"
IsEnabled="{Binding IsEnableDisable}" />
</StackPanel>
</Grid>
</UserControl>