JohnPWSharp / maui-modules

4 stars 3 forks source link

Navigation Crash #2

Open jamesmontemagno opened 2 years ago

jamesmontemagno commented 2 years ago

So the issue is with:

private async void editClicked(object sender, EventArgs args)
        {
            NavigationPage editPage = new NavigationPage(new Editor(displayBody));
            //await Navigation.PushModalAsync(editPage);
            await Navigation.PushAsync(editPage);
        }

When you wrap the "Editor" in a Navigation page there is a new navigation stack.

So technically you would have to do:

var topNav = ((NavigationPage)this.Parent.Parent).Navigation;

So I would recommend just not having another navigationpage there.

I have updated a bunch of things in the final exercise 3 --. https://github.com/JohnPWSharp/maui-modules/pull/1

JohnPWSharp commented 2 years ago

Thanks James. I’ll take a look on Monday

Cheers John

From: James Montemagno @.> Sent: 29 October 2021 17:01 To: JohnPWSharp/maui-modules @.> Cc: John Sharp @.>; Assign @.> Subject: EXT: [JohnPWSharp/maui-modules] Navigation Crash (Issue #2)

So the issue is with:

private async void editClicked(object sender, EventArgs args)

    {

        NavigationPage editPage = new NavigationPage(new Editor(displayBody));

        //await Navigation.PushModalAsync(editPage);

        await Navigation.PushAsync(editPage);

    }

When you wrap the "Editor" in a Navigation page there is a new navigation stack.

So technically you would have to do:

var topNav = ((NavigationPage)this.Parent.Parent).Navigation;

So I would recommend just not having another navigationpage there.

I have updated a bunch of things in the final exercise 3 --. #1https://github.com/JohnPWSharp/maui-modules/pull/1

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/JohnPWSharp/maui-modules/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAONHQVICFR5T5KI7JXBB5DUJLAMPANCNFSM5G7U5SDA.

THIS MESSAGE ORIGINATED FROM OUTSIDE THE COMPANY. PLEASE VERIFY THE AUTHENTICITY OF THIS EMAIL BEFORE FOLLOWING ANY LINKS OR REPLYING.

This email is sent for and on behalf of Civica UK Ltd, Civica NI Ltd, Civica Group Ltd or Civica Election Services Ltd, previously trading as Agylia Group Ltd. Civica Group Ltd (no: 04968437), Civica UK Ltd (no: 01628868) and Civica Election Services Ltd (no: 02263092) are registered in England at Southbank Central, 30 Stamford Street, London, SE1 9LQ. Civica NI Ltd (no: NI043987) is registered in Northern Ireland at 10 Weavers Court, Belfast, BT12 5GH. Privacy: Our privacy notice is available herehttps://www.civica.com/en-gb/policies-and-statements/privacy-notice/.

JohnPWSharp commented 2 years ago

Thanks James. I had been a bit over-zealous in creating new NavigationPage objects and didn’t spot what I had done. I have corrected the exercise and solution code.

Cheers

John

From: James Montemagno @.> Sent: 29 October 2021 17:01 To: JohnPWSharp/maui-modules @.> Cc: John Sharp @.>; Assign @.> Subject: EXT: [JohnPWSharp/maui-modules] Navigation Crash (Issue #2)

So the issue is with:

private async void editClicked(object sender, EventArgs args)

    {

        NavigationPage editPage = new NavigationPage(new Editor(displayBody));

        //await Navigation.PushModalAsync(editPage);

        await Navigation.PushAsync(editPage);

    }

When you wrap the "Editor" in a Navigation page there is a new navigation stack.

So technically you would have to do:

var topNav = ((NavigationPage)this.Parent.Parent).Navigation;

So I would recommend just not having another navigationpage there.

I have updated a bunch of things in the final exercise 3 --. #1https://github.com/JohnPWSharp/maui-modules/pull/1

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/JohnPWSharp/maui-modules/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAONHQVICFR5T5KI7JXBB5DUJLAMPANCNFSM5G7U5SDA.

THIS MESSAGE ORIGINATED FROM OUTSIDE THE COMPANY. PLEASE VERIFY THE AUTHENTICITY OF THIS EMAIL BEFORE FOLLOWING ANY LINKS OR REPLYING.

This email is sent for and on behalf of Civica UK Ltd, Civica NI Ltd, Civica Group Ltd or Civica Election Services Ltd, previously trading as Agylia Group Ltd. Civica Group Ltd (no: 04968437), Civica UK Ltd (no: 01628868) and Civica Election Services Ltd (no: 02263092) are registered in England at Southbank Central, 30 Stamford Street, London, SE1 9LQ. Civica NI Ltd (no: NI043987) is registered in Northern Ireland at 10 Weavers Court, Belfast, BT12 5GH. Privacy: Our privacy notice is available herehttps://www.civica.com/en-gb/policies-and-statements/privacy-notice/.