wip
This commit is contained in:
@@ -319,7 +319,7 @@ public partial class ObservableCollection<TItem> :
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(SelectionEventArgs<TItem> args) =>
|
||||
public Task Handle(SelectionEventArgs<TItem> args) =>
|
||||
Task.CompletedTask;
|
||||
|
||||
public int IndexOf(TItem item) =>
|
||||
@@ -342,6 +342,16 @@ public partial class ObservableCollection<TItem> :
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public TItem Insert<T>(int index = 0,
|
||||
params object?[] parameters)
|
||||
where T :
|
||||
TItem
|
||||
{
|
||||
T? item = Factory.Create<T>(parameters);
|
||||
InsertItem(0, item);
|
||||
|
||||
return item;
|
||||
}
|
||||
public void Insert(int index, TItem item) =>
|
||||
InsertItem(index, item);
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -4,8 +4,6 @@
|
||||
<FontFamily x:Key="FluentThemeFontFamily">/Fonts/#FluentSystemIcons-Resizable</FontFamily>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<MergeResourceInclude Source="../CarouselView/CarouselView.axaml" />
|
||||
<MergeResourceInclude Source="../SettingsExpander/SettingsExpander.axaml" />
|
||||
<MergeResourceInclude Source="../SettingsExpander/SettingsExpanderItem.axaml" />
|
||||
<MergeResourceInclude Source="../PersonPicture/PersonPicture.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user