FAView.xaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <UserControl x:Class="Aitex.Triton160.UI.Views.FAView"
  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:Aitex.Triton160.UI.Views"
  7. mc:Ignorable="d"
  8. d:DesignHeight="880" d:DesignWidth="1550" Background="#669ACC">
  9. <UserControl.Resources>
  10. <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  11. <Setter Property="Width" Value="65"></Setter>
  12. <Setter Property="Height" Value="30"></Setter>
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="ToggleButton">
  16. <!--定义视觉树-->
  17. <Border x:Name="border" BorderThickness="1.5" CornerRadius="9" BorderBrush="#aaa" Background="#2790ff">
  18. <Grid x:Name="togglebutton" HorizontalAlignment="Right" >
  19. <Border Width="25" Height="25" CornerRadius="9" Background="White"/>
  20. </Grid>
  21. <!--阴影设置-->
  22. <Border.Effect>
  23. <DropShadowEffect Color="Gray" BlurRadius="5" ShadowDepth="0" Opacity="0.5" />
  24. </Border.Effect>
  25. </Border>
  26. <!--定义触发器-->
  27. <ControlTemplate.Triggers>
  28. <Trigger Property="IsChecked" Value="false">
  29. <Setter TargetName="border" Property="Background" Value="#ccc"/>
  30. <Setter TargetName="togglebutton" Property="HorizontalAlignment" Value="Left"/>
  31. </Trigger>
  32. </ControlTemplate.Triggers>
  33. </ControlTemplate>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. </UserControl.Resources>
  38. <Canvas >
  39. <Grid Canvas.Left="288" Canvas.Top="150">
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="60" />
  42. <RowDefinition Height="40" />
  43. <RowDefinition Height="60" />
  44. </Grid.RowDefinitions>
  45. <Grid.ColumnDefinitions>
  46. <ColumnDefinition Width="130" />
  47. <ColumnDefinition Width="220" />
  48. </Grid.ColumnDefinitions>
  49. <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Fill="#376092" Margin="0" Stroke="White" StrokeThickness="1"></Rectangle>
  50. <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Foreground="White" Text="FA Enable" HorizontalAlignment="Center" FontSize="20" />
  51. <TextBlock Grid.Row="1" Text="Status" FontSize="18" />
  52. <Label Grid.Row="1" Grid.Column="1" Content="{Binding HostCommunicationStatus}" />
  53. <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  54. <Button Content="Enable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableEnableButton}" CommandParameter="FACommand,FAEnable" />
  55. <Button Content="Disable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableDisableButton}" CommandParameter="FACommand,FADisable" />
  56. </StackPanel>
  57. </Grid>
  58. <StackPanel Canvas.Left="288" Canvas.Top="450" Width="300" Height="150">
  59. <Label FontWeight="Bold" Margin="10">开启自动过站</Label>
  60. <!--<RadioButton GroupName="ready" FontSize="20" Margin="5" IsChecked="True" Checked="YES_RadioButton_Checked">Yes</RadioButton>
  61. <RadioButton GroupName="ready" FontSize="20" Margin="5" Checked="NO_RadioButton_Checked">No</RadioButton>-->
  62. <ToggleButton x:Name="IsAutoToggleButton" Style="{StaticResource ToggleButtonStyle}" Checked="ToggleButton_Checked" Unchecked="ToggleButton_Unchecked" Margin="10" HorizontalAlignment="Left" />
  63. </StackPanel>
  64. <Grid Canvas.Left="731" Canvas.Top="150" >
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="60" />
  67. <RowDefinition Height="40" />
  68. <RowDefinition Height="60" />
  69. <RowDefinition Height="60" />
  70. </Grid.RowDefinitions>
  71. <Grid.ColumnDefinitions>
  72. <ColumnDefinition Width="130" />
  73. <ColumnDefinition Width="220" />
  74. </Grid.ColumnDefinitions>
  75. <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Fill="#376092" Margin="0" Stroke="White" StrokeThickness="1"></Rectangle>
  76. <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Foreground="White" Text="FA Communication" HorizontalAlignment="Center" FontSize="20" />
  77. <TextBlock Grid.Row="1" Text="Status" FontSize="18" />
  78. <Label Grid.Row="1" Grid.Column="1" Content="{Binding HostControlStatus}" />
  79. <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  80. <Button Content="Online" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOnline" IsEnabled="{Binding IsEnableOnlineButton}"/>
  81. <Button Content="Offline" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOffline" IsEnabled="{Binding IsEnableOfflineButton}" />
  82. </StackPanel>
  83. <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  84. <Button Content="Local" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FALocal" IsEnabled="{Binding IsEnableLocalButton}" />
  85. <Button Content="Remote" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FARemote" IsEnabled="{Binding IsEnableRemoteButton}" />
  86. </StackPanel>
  87. </Grid>
  88. </Canvas>
  89. </UserControl>