Sic.Framework/SimulatorCore/Commons/SocketTitleView.xaml

42 lines
2.2 KiB
Plaintext
Raw Normal View History

2023-04-13 11:51:03 +08:00
<UserControl x:Class="MECF.Framework.Simulator.Core.Commons.SocketTitleView"
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">
<TextBox Text="{Binding LocalPortSetPoint, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }" VerticalContentAlignment="Center" Width="120" Margin="20,0,0,0" Height="35" />
<Label Content="Listen port:"></Label>
<Label Content="{Binding LocalPortSetPoint}"></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>
<Label Content="Connection:"></Label>
<Label Content="{Binding RemoteConnection}"></Label>
</StackPanel>
</Grid>
</UserControl>