From fd6d6ab2d86a806c91f2fcbfdbf8fd1ed892ce38 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 28 Jun 2026 01:13:08 +0100 Subject: [PATCH] postit: change MainPage base class from NavigationPage to ContentPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HomePage.OnLoginClick does Navigation.PushAsync(new MainPage { ... }). NavigationPage.PushAsync only accepts a Page (or Page subclass), not a MultiPage. MainPage was declared as public partial class MainPage : NavigationPage in MainPage.axaml.cs and the root of MainPage.axaml was which means 'new MainPage()' produced a MultiPage, not a Page. PushAsync against a MultiPage argument does not route through the standard Page push path; the visible result is that the login succeeds, LoginSucceeded fires, but the UI stays on LoginPage — the user is left looking at the post-login state without any navigation. The XAML content of MainPage (a StackPanel with the post CRUD UI, a ListBox, a TextEditor) does not need the multi-page container semantics — it's a single screen. Switch both the code-behind base class and the XAML root element to ContentPage so that MainPage is what PushAsync expects. --- src/PostIt/PostIt/Views/MainPage.axaml | 4 ++-- src/PostIt/PostIt/Views/MainPage.axaml.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/PostIt/PostIt/Views/MainPage.axaml b/src/PostIt/PostIt/Views/MainPage.axaml index b4b65be9..e6a0c59f 100644 --- a/src/PostIt/PostIt/Views/MainPage.axaml +++ b/src/PostIt/PostIt/Views/MainPage.axaml @@ -1,4 +1,4 @@ - - + diff --git a/src/PostIt/PostIt/Views/MainPage.axaml.cs b/src/PostIt/PostIt/Views/MainPage.axaml.cs index f84098cd..769234e3 100644 --- a/src/PostIt/PostIt/Views/MainPage.axaml.cs +++ b/src/PostIt/PostIt/Views/MainPage.axaml.cs @@ -1,14 +1,13 @@ - using Avalonia; using Avalonia.Controls; namespace PostIt.Views; -public partial class MainPage : NavigationPage +public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } -} \ No newline at end of file +}