From 35e9f09a5abe1c89c2bf2c622c4d56536943a413 Mon Sep 17 00:00:00 2001 From: Clement Sepulchre Date: Fri, 31 May 2024 15:13:46 +0200 Subject: [PATCH] #204 --- SukiUI/Controls/GlassMorphism/GlassCard.axaml | 2 +- SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/SukiUI/Controls/GlassMorphism/GlassCard.axaml b/SukiUI/Controls/GlassMorphism/GlassCard.axaml index 0be3ddd48..b7bc42a31 100644 --- a/SukiUI/Controls/GlassMorphism/GlassCard.axaml +++ b/SukiUI/Controls/GlassMorphism/GlassCard.axaml @@ -46,7 +46,7 @@ - + diff --git a/SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs b/SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs index 65d21b1ff..e2d153ce4 100644 --- a/SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs +++ b/SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs @@ -3,6 +3,7 @@ using System.Windows.Input; using Avalonia; using Avalonia.Controls; +using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; using Avalonia.Input; using Avalonia.Interactivity; @@ -88,6 +89,13 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e) var v = ElementComposition.GetElementVisual(b2); MakeSizeAnimated(v); }; + + var b3 = e.NameScope.Get("PART_ClipBorder"); + b3.Loaded += (sender, args) => + { + var v = ElementComposition.GetElementVisual(b3); + MakeSizeAnimated(v); + }; @@ -151,6 +159,8 @@ public static void MakeSizeAnimated(CompositionVisual compositionVisual) offsetAnimation.InsertExpressionKeyFrame(1.0f, "this.FinalValue"); offsetAnimation.Duration = TimeSpan.FromMilliseconds(450); + + animationGroup.Add(sizeAnimation); animationGroup.Add(offsetAnimation);