|
- <UserControl
- x:Class="BPASmartClient.Academy.CustomControls.ValveWithCommandState"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:bpa="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.Academy.CustomControls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="32"
- d:DesignWidth="32" mc:Ignorable="d">
- <UserControl.Resources>
- <Style x:Key="BaseHandValveStyle" TargetType="bpa:HandValve">
- <Setter Property="Width" Value="32" />
- <Setter Property="Height" Value="32" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- <Style x:Key="CommandStateStyle" TargetType="TextBlock">
- <Setter Property="Height" Value="16" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Margin" Value="0,3,6,0" />
- <Setter Property="TextAlignment" Value="Center" />
- <Setter Property="Text" Value="⬛" />
- </Style>
- </UserControl.Resources>
- <Grid>
- <bpa:HandValve
- EdgeColor="{Binding Path=EdgeColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
- OpenEnable="{Binding Path=OpenEnable, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
- Style="{StaticResource BaseHandValveStyle}" />
- <TextBlock
- d:Foreground="Red"
- Foreground="{Binding Path=CommandColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
- Style="{StaticResource CommandStateStyle}" />
- </Grid>
- </UserControl>
|