feat: add ItemsControl template.

This commit is contained in:
rabbitism 2023-01-11 00:20:32 +08:00 committed by Dong Bin
parent dc63fb58c9
commit 03067ca007
2 changed files with 21 additions and 0 deletions

View File

@ -7,6 +7,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ItemsControl.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Label.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ListBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/PathIcon.axaml" />

View File

@ -0,0 +1,20 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type ItemsControl}" TargetType="ItemsControl">
<Setter Property="Template">
<ControlTemplate>
<Border
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ItemsPresenter
Name="PART_ItemsPresenter"
ItemTemplate="{TemplateBinding ItemTemplate}"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>