38 lines
2.5 KiB
XML
38 lines
2.5 KiB
XML
<UserControl x:Class="AuroraUIComponent.UserControls.UCLedLightText"
|
|
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:AuroraUIComponent.UserControls"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="10" d:DesignWidth="100"
|
|
Name="root"
|
|
xmlns:aurora="clr-namespace:Aurora.View;assembly=Aurora"
|
|
xmlns:uiconverter="clr-namespace:AuroraUIComponent.UIConverter">
|
|
<UserControl.Resources>
|
|
<local:LedLightConverter x:Key="LedConverter"/>
|
|
<uiconverter:NullCollapseConverter x:Key="convNullCollapse"/>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="{Binding LEDWidth, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
|
<ColumnDefinition Width="{Binding KeyTextWidth, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Viewbox>
|
|
<Canvas Height="15" Width="15" Margin="3">
|
|
<Ellipse Canvas.Left="0" Canvas.Top="0" Width="15" Height="15" StrokeThickness="2" Stroke="White" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
Fill="{Binding LedStatusVal, ElementName=root, Converter={StaticResource LedConverter}}" >
|
|
</Ellipse>
|
|
</Canvas>
|
|
</Viewbox>
|
|
<Border Grid.Column="1" Visibility="{Binding KeyText, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource convNullCollapse}, FallbackValue=Visible}" BorderThickness="0"
|
|
Background="{Binding KeyTextBgColor, RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="2">
|
|
<TextBlock x:Name="TextKey" Grid.Column="0" Margin="5 0"
|
|
Text="{Binding KeyText, RelativeSource={RelativeSource AncestorType=UserControl}, FallbackValue=Label}"
|
|
FontSize="{Binding KeyTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
Foreground="{Binding KeyTextFgColor, RelativeSource={RelativeSource AncestorType=UserControl}, FallbackValue=White}"
|
|
HorizontalAlignment="{Binding KeyHorizontalAlignment, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
|
|
</Border>
|
|
</Grid>
|
|
</UserControl>
|