新增骨架屏控件

This commit is contained in:
Coolkeke
2023-12-27 00:30:42 +08:00
parent 1d6f3b10ce
commit 30a303f524
17 changed files with 209 additions and 1 deletions

View File

@@ -0,0 +1,57 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<Design.PreviewWith>
<Border Padding="20">
<!-- Add Controls for Previewer Here -->
</Border>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type u:Skeleton}" TargetType="u:Skeleton">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="u:Skeleton">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="{TemplateBinding ClipToBounds}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid>
<ContentPresenter
x:Name="PART_ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Border
x:Name="PART_Border"
IsHitTestVisible="{TemplateBinding IsActive}"
IsVisible="{TemplateBinding IsActive}">
<Border.Styles>
<Style Selector="Border">
<Style.Animations>
<Animation
FillMode="None"
IterationCount="Infinite"
Duration="0:0:1.4">
<KeyFrame Cue="0%">
<Setter Property="Background" Value="{DynamicResource SkeletonStartAnimationBackground}" />
</KeyFrame>
<KeyFrame Cue="100%">
<Setter Property="Background" Value="{DynamicResource SkeletonEndAnimationBackground}" />
</KeyFrame>
</Animation>
</Style.Animations>
</Style>
</Border.Styles>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</ControlTheme>
<!-- Add Styles Here -->
</ResourceDictionary>

View File

@@ -13,5 +13,6 @@
<ResourceInclude Source="Pagination.axaml" />
<ResourceInclude Source="TagInput.axaml" />
<ResourceInclude Source="Timeline.axaml" />
<ResourceInclude Source="Skeleton.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>