SocketTitleView.xaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <UserControl x:Class="MECF.Framework.Simulator.Core.Commons.SocketTitleView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.Commons"
  7. mc:Ignorable="d"
  8. d:DesignHeight="100" d:DesignWidth="800" Background="LightBlue">
  9. <UserControl.Resources>
  10. <local:ConnectionStatusBackgroundConverter x:Key="connectionStatusBackgroundConverter"/>
  11. <Style TargetType="Label">
  12. <Setter Property="FontSize" Value="16" />
  13. <Setter Property="Padding" Value="10,0,10,0" />
  14. <Setter Property="VerticalContentAlignment" Value="Center" />
  15. </Style>
  16. </UserControl.Resources>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="50"></RowDefinition>
  20. <RowDefinition Height="50"></RowDefinition>
  21. </Grid.RowDefinitions>
  22. <Label Grid.Row="0" Content="{Binding Title}" FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="50" Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}"></Label>
  23. <StackPanel Grid.Row="1" Orientation="Horizontal">
  24. <TextBox Text="{Binding LocalPortSetPoint, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }" VerticalContentAlignment="Center" Width="120" Margin="20,0,0,0" Height="35" />
  25. <Label Content="Listen port:"></Label>
  26. <Label Content="{Binding LocalPortSetPoint}"></Label>
  27. <Label Content="{Binding ConnectionStatus}"></Label>
  28. <Button Width="100" Height="35" Content="Enable" Command="{Binding EnableCommand}" IsEnabled="{Binding IsEnableEnable}"></Button>
  29. <Button Width="100" Height="35" Content="Disable" Command="{Binding DisableCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
  30. <Label Content="Connection:"></Label>
  31. <Label Content="{Binding RemoteConnection}"></Label>
  32. </StackPanel>
  33. </Grid>
  34. </UserControl>