From e6d22aae9224ca4c4fee62d8d3256f738b80b8ae Mon Sep 17 00:00:00 2001 From: Alexander Marek Date: Fri, 17 Jan 2025 14:28:16 +0100 Subject: [PATCH] #69 - fixed NullReferenceException in Page.OnLoaded to support avalonia previewers (Visual Studio and Rider) --- src/AvaloniaInside.Shell/Page.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AvaloniaInside.Shell/Page.cs b/src/AvaloniaInside.Shell/Page.cs index 682f3d9..117961f 100644 --- a/src/AvaloniaInside.Shell/Page.cs +++ b/src/AvaloniaInside.Shell/Page.cs @@ -307,6 +307,10 @@ protected override void OnLoaded(RoutedEventArgs e) this[!ApplyLeftSafePaddingProperty] = this[!ShellView.EnableSafeAreaForLeftProperty]; this[!ApplyRightSafePaddingProperty] = this[!ShellView.ApplyRightSafePaddingProperty]; + // allow previewer to display page-based views + if (Design.IsDesignMode && Chain is null) + return; + IsModal = Chain.Type == NavigateType.Modal; }