fix: fix EnumSelector default Width & Alignment.

This commit is contained in:
Zhang Dian
2024-06-24 16:30:29 +08:00
parent 68c799b032
commit aabc2c9577
2 changed files with 9 additions and 4 deletions

View File

@@ -4,12 +4,13 @@
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:EnumSelector}" TargetType="u:EnumSelector">
<Setter Property="Width" Value="100" />
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Template">
<ControlTemplate TargetType="u:EnumSelector">
<ComboBox
Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width}"
Width="{TemplateBinding Width}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Name="PART_ComboBox"
ItemsSource="{TemplateBinding Values}"
SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedValue, Mode=TwoWay}" />