2026-01-26 14:51:28 +09:00

56 lines
3.9 KiB
XML

<base:UCKeyValueBase x:Class="AuroraUIComponent.UserControls.UCKeyValueCheckBox"
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"
xmlns:base="clr-namespace:AuroraUIComponent.UserControls.KeyValueBase"
xmlns:view="clr-namespace:Aurora.View;assembly=Aurora"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="500" FontSize="12">
<UserControl.Resources>
<local:CheckBoxContentConverter x:Key="convValueBool"/>
</UserControl.Resources>
<Grid x:Name="GridParent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding KeyTextWidth, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
<ColumnDefinition Width="{Binding ValueTextWidth, RelativeSource={RelativeSource AncestorType=UserControl}}"/>
</Grid.ColumnDefinitions>
<Border Background="{Binding KeyTextBgColor, RelativeSource={RelativeSource AncestorType=UserControl}}" Margin="2">
<TextBlock Grid.Column="0" Margin="5 0"
Text="{Binding KeyText, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontSize="{Binding KeyTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}"
Foreground="{Binding KeyTextFgColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
HorizontalAlignment="{Binding KeyHorizontalAlignment, RelativeSource={RelativeSource AncestorType=UserControl}}"
VerticalAlignment="Center"/>
</Border>
<Grid Grid.Column="1"
HorizontalAlignment="{Binding ValueHorizontalAlignment, RelativeSource={RelativeSource AncestorType=UserControl}}"
IsEnabled="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=UserControl}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<CheckBox Name="TextValue" HorizontalContentAlignment="Center" Padding="2 0"
Margin="2" VerticalContentAlignment="Center" Height="Auto"
HorizontalAlignment="{Binding ValueHorizontalAlignment, RelativeSource={RelativeSource AncestorType=UserControl}}"
IsEnabled="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=UserControl}}"
IsChecked="{Binding ValueBool, RelativeSource={RelativeSource AncestorType=UserControl}}">
</CheckBox>
<TextBlock Grid.Column="2"
FontSize="{Binding ValueTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}"
Foreground="{Binding ValueTextFgColor, RelativeSource={RelativeSource AncestorType=UserControl}}"
Background="{Binding ValueTextBgColor, RelativeSource={RelativeSource AncestorType=UserControl}}">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource convValueBool}">
<Binding Path="ValueBool" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
<Binding Path="TrueValueStr" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
<Binding Path="FalseValueStr" RelativeSource="{RelativeSource AncestorType=UserControl}"/>
<!-- Add more bindings as needed -->
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</Grid>
</Grid>
</base:UCKeyValueBase>