Merge pull request #429 from irihitech/enumselector

Add small/large size to enum selector.
This commit is contained in:
Dong Bin
2024-10-04 00:26:42 +08:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -26,5 +26,12 @@
EnumType="{Binding SelectedType}"
Value="{Binding Value}" />
<TextBlock Text="{Binding Value}" />
<u:Divider Content="Small Size"></u:Divider>
<u:EnumSelector
Width="200"
Classes="Small"
DisplayDescription="{Binding #description.IsChecked}"
EnumType="{Binding SelectedType}"
Value="{Binding Value}" />
</StackPanel>
</UserControl>

View File

@@ -1,7 +1,8 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
xmlns:u="https://irihi.tech/ursa"
xmlns:u-semi="https://irihi.tech/ursa/themes/semi">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:EnumSelector}" TargetType="u:EnumSelector">
<Setter Property="HorizontalAlignment" Value="Left" />
@@ -9,6 +10,7 @@
<ControlTemplate TargetType="u:EnumSelector">
<ComboBox
Width="{TemplateBinding Width}"
u-semi:ClassHelper.ClassSource="{TemplateBinding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Name="PART_ComboBox"