mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-10 03:30:49 +08:00
fix: 修复ComboBox控件的PlaceholderForeground属性失效
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox Width="100" PlaceholderText="Select">
|
||||
<ComboBox Width="100" PlaceholderText="Select" PlaceholderForeground="Red">
|
||||
<ComboBoxItem>AAA</ComboBoxItem>
|
||||
<ComboBoxItem>BBB</ComboBoxItem>
|
||||
<ComboBoxItem>CCC</ComboBoxItem>
|
||||
@@ -44,6 +44,7 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxDefaultHeight}" />
|
||||
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxSelectorPlaceHolderForeground}"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<DataValidationErrors>
|
||||
@@ -65,7 +66,7 @@
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Foreground="{TemplateBinding PlaceholderForeground}"
|
||||
IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}"
|
||||
Opacity="0.3"
|
||||
Text="{TemplateBinding PlaceholderText}" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="ComboBoxSelectorBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPlaceHolderForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPointeroverBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="ComboBoxSelectorFocusBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StaticResource x:Key="ComboBoxSelectorBackground" ResourceKey="SemiColorFill0" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPlaceHolderForeground" ResourceKey="SemiColorText0" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPointeroverBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="ComboBoxSelectorFocusBackground" ResourceKey="SemiColorFill1" />
|
||||
<StaticResource x:Key="ComboBoxSelectorPressedBackground" ResourceKey="SemiColorFill2" />
|
||||
|
||||
Reference in New Issue
Block a user