fix: fix EnumSelector default Width & Alignment.
This commit is contained in:
@@ -18,12 +18,16 @@
|
||||
<Setter Property="Width" Value="{Binding ItemSelfWidth}" />
|
||||
<Setter Property="Height" Value="{Binding ItemSelfHeight}" />
|
||||
</Style>
|
||||
<Style Selector="u|EnumSelector">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<DockPanel>
|
||||
<u:Form DockPanel.Dock="Left"
|
||||
LabelAlignment="Left"
|
||||
LabelPosition="Left"
|
||||
LabelWidth="*">
|
||||
LabelWidth="*"
|
||||
Margin="4 0">
|
||||
<u:FormGroup>
|
||||
<u:FormItem Label="Orientation">
|
||||
<u:EnumSelector EnumType="Orientation" Value="{Binding SelectedOrientation}" />
|
||||
|
||||
@@ -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}" />
|
||||
|
||||
Reference in New Issue
Block a user