40 lines
2.1 KiB
XML
40 lines
2.1 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Commons"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="100" d:DesignWidth="800" Background="LightBlue">
|
|
<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>
|
|
<RowDefinition Height="50"></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<Label Grid.Row="0" Content="{Binding Title}" FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="50" Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}"></Label>
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal">
|
|
<ComboBox SelectedItem="{Binding LocalPortSetPoint, Mode=TwoWay}" ItemsSource="{Binding PortList}" VerticalContentAlignment="Center" Width="120" Margin="20,0,0,0" Height="35" />
|
|
<Label Content="Port:"></Label>
|
|
<Label Content="{Binding LocalPort}"></Label>
|
|
|
|
<Label Content="{Binding ConnectionStatus}"></Label>
|
|
|
|
<Button Width="100" Height="35" Content="Enable" Command="{Binding EnableCommand}" IsEnabled="{Binding IsEnableEnable}"></Button>
|
|
<Button Width="100" Height="35" Content="Disable" Command="{Binding DisableCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
|
|
|
|
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|
|
|