From 5470c1272f7601ea96882373e0c4ce8ab56ce914 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 11 May 2023 12:39:24 +0200 Subject: [PATCH] Set default transition. Not really sure we should be doing this, but the previous version had it (though it was using a mutable object as a `StyledProperty` default value which means the instance was shared: bad). --- src/Avalonia.Controls/TransitioningContentControl.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Avalonia.Controls/TransitioningContentControl.cs b/src/Avalonia.Controls/TransitioningContentControl.cs index 116b61d358..943ceaf27c 100644 --- a/src/Avalonia.Controls/TransitioningContentControl.cs +++ b/src/Avalonia.Controls/TransitioningContentControl.cs @@ -24,6 +24,13 @@ public class TransitioningContentControl : ContentControl public static readonly StyledProperty PageTransitionProperty = AvaloniaProperty.Register(nameof(PageTransition)); + [System.Diagnostics.CodeAnalysis.SuppressMessage("AvaloniaProperty", "AVP1012", + Justification = "Default property values shouldn't be set with SetCurrentValue.")] + public TransitioningContentControl() + { + PageTransition = new CrossFade(TimeSpan.FromMilliseconds(125)); + } + /// /// Gets or sets the animation played when content appears and disappears. ///