mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
Update AutoCompleteBox style to use ClassHelper for Bordered TextBox (#747)
* feat: update AutoCompleteBox style to use ClassHelper for Bordered TextBox. * Update src/Semi.Avalonia/Controls/AutoCompleteBox.axaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: unitize Bordered style selectors. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:iri="https://irihi.tech/shared">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Margin="20" Spacing="20">
|
<StackPanel Margin="20" Spacing="20">
|
||||||
<TextBox Text="Hello" />
|
<TextBox Text="Hello" />
|
||||||
@@ -56,45 +57,13 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<Style Selector="^.Bordered">
|
<Style Selector="^.Bordered">
|
||||||
<Setter Property="Template">
|
<Style Selector="^ /template/ TextBox#PART_TextBox">
|
||||||
<ControlTemplate TargetType="AutoCompleteBox">
|
<Setter Property="MinHeight" Value="0" />
|
||||||
<Panel>
|
<Setter Property="iri:ClassHelper.Classes" Value="Bordered" />
|
||||||
<TextBox
|
</Style>
|
||||||
Name="PART_TextBox"
|
<Style Selector="^ /template/ ListBox#PART_SelectingItemsControl">
|
||||||
VerticalAlignment="Stretch"
|
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="False" />
|
||||||
MinHeight="0"
|
</Style>
|
||||||
Classes="Bordered"
|
|
||||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
|
||||||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}"
|
|
||||||
PlaceholderText="{TemplateBinding PlaceholderText}" />
|
|
||||||
<Popup
|
|
||||||
Name="PART_Popup"
|
|
||||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
||||||
InheritsTransform="True"
|
|
||||||
IsLightDismissEnabled="True"
|
|
||||||
PlacementTarget="{TemplateBinding}">
|
|
||||||
<Border
|
|
||||||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
|
||||||
Margin="{DynamicResource AutoCompleteBoxPopupMargin}"
|
|
||||||
Padding="{DynamicResource AutoCompleteBoxPopupPadding}"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Background="{DynamicResource AutoCompleteBoxPopupBackground}"
|
|
||||||
BorderBrush="{DynamicResource AutoCompleteBoxPopupBorderBrush}"
|
|
||||||
BorderThickness="{DynamicResource AutoCompleteBoxPopupBorderThickness}"
|
|
||||||
BoxShadow="{DynamicResource AutoCompleteBoxPopupBoxShadow}"
|
|
||||||
CornerRadius="{DynamicResource AutoCompleteBoxPopupCornerRadius}">
|
|
||||||
<ListBox
|
|
||||||
Name="PART_SelectingItemsControl"
|
|
||||||
Foreground="{TemplateBinding Foreground}"
|
|
||||||
ItemTemplate="{TemplateBinding ItemTemplate}"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
||||||
ScrollViewer.IsScrollChainingEnabled="False" />
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
</Panel>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^.Large">
|
<Style Selector="^.Large">
|
||||||
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
|
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user