Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed May 31, 2024
1 parent ed21ac3 commit 35e9f09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SukiUI/Controls/GlassMorphism/GlassCard.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<BrushTransition Property="BorderBrush" Duration="0:0:0.15" />
</Transitions>
</Border.Transitions>
<ContentPresenter Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" />
<ContentPresenter Name="PART_CP" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" />
</Border>
</Panel>
</ControlTemplate>
Expand Down
10 changes: 10 additions & 0 deletions SukiUI/Controls/GlassMorphism/GlassCard.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,6 +89,13 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
var v = ElementComposition.GetElementVisual(b2);
MakeSizeAnimated(v);
};

var b3 = e.NameScope.Get<Border>("PART_ClipBorder");
b3.Loaded += (sender, args) =>
{
var v = ElementComposition.GetElementVisual(b3);
MakeSizeAnimated(v);
};



Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 35e9f09

Please sign in to comment.