diff --git a/src/Ursa/Controls/AspectRatioLayout/AspectRatioLayout.cs b/src/Ursa/Controls/AspectRatioLayout/AspectRatioLayout.cs index e1f7da5..86a372f 100644 --- a/src/Ursa/Controls/AspectRatioLayout/AspectRatioLayout.cs +++ b/src/Ursa/Controls/AspectRatioLayout/AspectRatioLayout.cs @@ -11,7 +11,7 @@ public class AspectRatioLayout : TransitioningContentControl { public static readonly StyledProperty> ItemsProperty = AvaloniaProperty.Register>( - nameof(Items), new List()); + nameof(Items)); public static readonly StyledProperty AspectRatioChangeAmbiguityProperty = AvaloniaProperty.Register( @@ -21,12 +21,6 @@ public class AspectRatioLayout : TransitioningContentControl AvaloniaProperty.Register( nameof(CurrentAspectRatioMode)); - public AspectRatioMode CurrentAspectRatioMode - { - get => GetValue(CurrentAspectRatioModeProperty); - set => SetValue(CurrentAspectRatioModeProperty, value); - } - private readonly Queue _history = new(); static AspectRatioLayout() @@ -40,6 +34,17 @@ public class AspectRatioLayout : TransitioningContentControl PageTransitionProperty.OverrideDefaultValue(pCrossFade); } + public AspectRatioLayout() + { + Items = new List(); + } + + public AspectRatioMode CurrentAspectRatioMode + { + get => GetValue(CurrentAspectRatioModeProperty); + set => SetValue(CurrentAspectRatioModeProperty, value); + } + protected override Type StyleKeyOverride => typeof(TransitioningContentControl); [Content]