2026-06-05 13:44:39 +09:00

35 lines
2.9 KiB
XML

<base:UCKeyValueBase x:Class="AuroraUIComponent.UserControls.UCKeyComboBoxOnOff"
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:DataContext="{d:DesignInstance Type=local:UCKeyComboBoxOnOff}"
d:DesignHeight="50" d:DesignWidth="500" FontSize="12">
<UserControl.Resources>
<view:IntToOnOffStringConverter x:Key="convOnOff"/>
</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 x:Name="TextKey" Grid.Column="0" Margin="5 0" FontWeight="Bold"
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}}"/>
</Border>
<ComboBox Name="TextValue" Grid.Column="1" Margin="2" IsEditable="False" VerticalContentAlignment="Center" Padding="2 0"
HorizontalContentAlignment="{Binding ValueHorizontalAlignment, RelativeSource={RelativeSource AncestorType=UserControl}}"
FontSize="{Binding ValueTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}"
Text="{Binding Path=ValueText, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource convOnOff}}">
<ComboBoxItem FontSize="{Binding ValueTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}" Content="OFF" HorizontalContentAlignment="Center"/>
<ComboBoxItem FontSize="{Binding ValueTextSize, RelativeSource={RelativeSource AncestorType=UserControl}}" Content="ON" HorizontalContentAlignment="Center"/>
<!-- TODO: {Binding [ON], Source={StaticResource langTokens}} -->
</ComboBox>
</Grid>
</base:UCKeyValueBase>