This commit is contained in:
TheXamlGuy
2024-05-26 18:09:53 +01:00
parent 2bd7b54fa0
commit baf504b815
5 changed files with 12 additions and 97 deletions
@@ -1,52 +0,0 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Toolkit.UI.Controls.Avalonia"
xmlns:ui="using:FluentAvalonia.UI.Controls">
<Design.PreviewWith>
<Border Padding="20" />
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type controls:SettingsExpander}" TargetType="controls:SettingsExpander">
<Setter Property="Background" Value="{DynamicResource ExpanderBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderHeaderBorderThickness}" />
<Setter Property="Padding" Value="{DynamicResource SettingsExpanderPadding}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="MinHeight" Value="{DynamicResource SettingsExpanderMinHeight}" />
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<StackPanel Spacing="1" />
</ItemsPanelTemplate>
</Setter>
<Setter Property="Template">
<ControlTemplate>
<Expander
Name="Expander"
IsExpanded="{TemplateBinding IsExpanded,
Mode=TwoWay}"
Theme="{StaticResource SettingsExpanderExpanderStyle}">
<Expander.Header>
<controls:SettingsExpanderItem
Name="ContentHost"
Padding="{DynamicResource SettingsExpanderPadding}"
ActionIconSource="{TemplateBinding ActionIconSource}"
Background="Transparent"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Description="{TemplateBinding Description}"
Footer="{TemplateBinding Footer}"
FooterTemplate="{TemplateBinding FooterTemplate}"
IconSource="{TemplateBinding IconSource}"
IsClickEnabled="{TemplateBinding IsClickEnabled}" />
</Expander.Header>
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" />
</Expander>
</ControlTemplate>
</Setter>
<Style Selector="^:empty /template/ ItemsPresenter#ItemsHost">
<Setter Property="IsVisible" Value="False" />
</Style>
</ControlTheme>
</ResourceDictionary>
@@ -5,29 +5,5 @@ namespace Toolkit.UI.Controls.Avalonia;
public class SettingsExpander : FluentAvalonia.UI.Controls.SettingsExpander
{
protected override Type StyleKeyOverride =>
typeof(SettingsExpander);
public new static readonly StyledProperty<object> DescriptionProperty =
AvaloniaProperty.Register<SettingsExpander, object>(nameof(Description));
public new object Description
{
get => GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
}
public class SettingsExpanderItem : FluentAvalonia.UI.Controls.SettingsExpanderItem
{
protected override Type StyleKeyOverride =>
typeof(SettingsExpanderItem);
public new static readonly StyledProperty<object> DescriptionProperty =
AvaloniaProperty.Register<SettingsExpanderItem, object>(nameof(Description));
public new object Description
{
get => GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
typeof(FluentAvalonia.UI.Controls.SettingsExpander);
}
@@ -1,17 +0,0 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Toolkit.UI.Controls.Avalonia"
xmlns:ui="using:FluentAvalonia.UI.Controls">
<Design.PreviewWith>
<Border Padding="20" />
</Design.PreviewWith>
<Thickness x:Key="SettingsExpanderItemPadding">16 10</Thickness>
<x:Double x:Key="SettingsExpanderItemMinHeight">48</x:Double>
<Thickness x:Key="SettingsExpanderItemContentMargin">42 0 0 0</Thickness>
<Thickness x:Key="SettingsExpanderItemFooterMargin">16 0 0 0</Thickness>
<Thickness x:Key="SettingsExpanderItemBottomFooterMargin">42 16 0 0</Thickness>
<x:Double x:Key="SettingsExpanderItemIconSize">24</x:Double>
<x:Double x:Key="SettingsExpanderItemActionIconSize">18</x:Double>
<x:Double x:Key="SettingsExpanderItemAdaptiveWidthTrigger">460</x:Double>
</ResourceDictionary>