123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <UserControl x:Class="Aitex.Triton160.UI.Views.FAView"
- 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:Aitex.Triton160.UI.Views"
- mc:Ignorable="d"
- d:DesignHeight="880" d:DesignWidth="1550" Background="#669ACC">
- <UserControl.Resources>
- <Style x:Key="ToggleButtonStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="Width" Value="65"></Setter>
- <Setter Property="Height" Value="30"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <!--定义视觉树-->
- <Border x:Name="border" BorderThickness="1.5" CornerRadius="9" BorderBrush="#aaa" Background="#2790ff">
- <Grid x:Name="togglebutton" HorizontalAlignment="Right" >
- <Border Width="25" Height="25" CornerRadius="9" Background="White"/>
- </Grid>
- <!--阴影设置-->
- <Border.Effect>
- <DropShadowEffect Color="Gray" BlurRadius="5" ShadowDepth="0" Opacity="0.5" />
- </Border.Effect>
- </Border>
- <!--定义触发器-->
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="false">
- <Setter TargetName="border" Property="Background" Value="#ccc"/>
- <Setter TargetName="togglebutton" Property="HorizontalAlignment" Value="Left"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Canvas >
- <Grid Canvas.Left="288" Canvas.Top="150">
- <Grid.RowDefinitions>
- <RowDefinition Height="60" />
- <RowDefinition Height="40" />
- <RowDefinition Height="60" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="130" />
- <ColumnDefinition Width="220" />
- </Grid.ColumnDefinitions>
- <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Fill="#376092" Margin="0" Stroke="White" StrokeThickness="1"></Rectangle>
- <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Foreground="White" Text="FA Enable" HorizontalAlignment="Center" FontSize="20" />
- <TextBlock Grid.Row="1" Text="Status" FontSize="18" />
- <Label Grid.Row="1" Grid.Column="1" Content="{Binding HostCommunicationStatus}" />
- <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center">
- <Button Content="Enable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableEnableButton}" CommandParameter="FACommand,FAEnable" />
- <Button Content="Disable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableDisableButton}" CommandParameter="FACommand,FADisable" />
- </StackPanel>
- </Grid>
- <StackPanel Canvas.Left="288" Canvas.Top="450" Width="300" Height="150">
- <Label FontWeight="Bold" Margin="10">开启自动过站</Label>
- <!--<RadioButton GroupName="ready" FontSize="20" Margin="5" IsChecked="True" Checked="YES_RadioButton_Checked">Yes</RadioButton>
- <RadioButton GroupName="ready" FontSize="20" Margin="5" Checked="NO_RadioButton_Checked">No</RadioButton>-->
- <ToggleButton x:Name="IsAutoToggleButton" Style="{StaticResource ToggleButtonStyle}" Checked="ToggleButton_Checked" Unchecked="ToggleButton_Unchecked" Margin="10" HorizontalAlignment="Left" />
- </StackPanel>
- <Grid Canvas.Left="731" Canvas.Top="150" >
- <Grid.RowDefinitions>
- <RowDefinition Height="60" />
- <RowDefinition Height="40" />
- <RowDefinition Height="60" />
- <RowDefinition Height="60" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="130" />
- <ColumnDefinition Width="220" />
- </Grid.ColumnDefinitions>
- <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Fill="#376092" Margin="0" Stroke="White" StrokeThickness="1"></Rectangle>
- <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Foreground="White" Text="FA Communication" HorizontalAlignment="Center" FontSize="20" />
- <TextBlock Grid.Row="1" Text="Status" FontSize="18" />
- <Label Grid.Row="1" Grid.Column="1" Content="{Binding HostControlStatus}" />
- <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center">
- <Button Content="Online" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOnline" IsEnabled="{Binding IsEnableOnlineButton}"/>
- <Button Content="Offline" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOffline" IsEnabled="{Binding IsEnableOfflineButton}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Center">
- <Button Content="Local" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FALocal" IsEnabled="{Binding IsEnableLocalButton}" />
- <Button Content="Remote" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FARemote" IsEnabled="{Binding IsEnableRemoteButton}" />
- </StackPanel>
- </Grid>
-
- </Canvas>
- </UserControl>
|