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

67 lines
2.4 KiB
Plaintext
Raw Normal View History

2023-12-05 15:53:17 +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: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">
2023-04-13 11:51:03 +08:00
<UserControl.Resources>
2023-12-05 15:53:17 +08:00
<local:ConnectionStatusBackgroundConverter x:Key="connectionStatusBackgroundConverter" />
2023-04-13 11:51:03 +08:00
<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>
2023-12-05 15:53:17 +08:00
<RowDefinition Height="50" />
<RowDefinition Height="50" />
2023-04-13 11:51:03 +08:00
</Grid.RowDefinitions>
2023-12-05 15:53:17 +08:00
<Label
Grid.Row="0"
Height="50"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}"
Content="{Binding Title}"
FontSize="20" />
2023-04-13 11:51:03 +08:00
<StackPanel Grid.Row="1" Orientation="Horizontal">
2023-12-05 15:53:17 +08:00
<TextBox
Width="120"
Height="35"
Margin="20,0,0,0"
VerticalContentAlignment="Center"
Text="{Binding LocalPortSetPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
2023-04-13 11:51:03 +08:00
2023-12-05 15:53:17 +08:00
<Label Content="Listen port:" />
<Label Content="{Binding LocalPortSetPoint}" />
2023-04-13 11:51:03 +08:00
2023-12-05 15:53:17 +08:00
<Label Content="{Binding ConnectionStatus}" />
2023-04-13 11:51:03 +08:00
2023-12-05 15:53:17 +08:00
<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}" />
<Label Content="Connection:" />
<Label Content="{Binding RemoteConnection}" />
2023-04-13 11:51:03 +08:00
</StackPanel>
</Grid>
</UserControl>