Navigation - cant go back in basic MainPage / SecondPage scenario , what am I doing wrong ? #2301
Replies: 2 comments 4 replies
-
Hi @DomagojJugovich, as you mentioned here unoplatform/uno#16586 (reply in thread) I think it would be helpful if you could share your solution if possible. cc @nickrandolph |
Beta Was this translation helpful? Give feedback.
-
In commerce example and in default tempates there is aproximately ShellPage->MainPage->SecondPage. So why it works that way, why is shellpage needed, or to rephrase why first loaded page is not in back history ? Thx again. |
Beta Was this translation helpful? Give feedback.
-
I migrated oldour old UNO app, but I created new project/solution with newest templates for UnoSDK / WinUI only, and migrated all may code and files. By that I migrated to Uno SDK, single project and WinUI at once. So it should be clean from inconsistency problems.
![image](https://private-user-images.githubusercontent.com/3256682/333196885-3d79ada2-834b-4df5-adf1-b64c77aa693b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwOTk5MTEsIm5iZiI6MTcyMDA5OTYxMSwicGF0aCI6Ii8zMjU2NjgyLzMzMzE5Njg4NS0zZDc5YWRhMi04MzRiLTRkZjUtYWRmMS1iNjRjNzdhYTY5M2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDRUMTMyNjUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTYzYTY1NDVjMWU2MjQ0NTFlMjFlODhhYzkyMWZkMjRmZDkyODkxYWRlMmRkOWJhM2ZiNjhhZGQyM2M3NzcwOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.agqIgFhX9b1B6bLUsybTtTuVqyRIJZfxtr2c1ik3fhk)
All UWP to WinUI tidbits are solved and app runs (first screen loads), Desktop head works, Android works.
So navigation is not working how it worked before, so I looked at tutorials and reworked to :
I have no RegisterRoutes for now, as I see that is not important.
I am trying very simple scenario just to go to other page and back.
I am not able to go back ! ****
I registered event on PostavkePage (think secondPage):
This event fires on android emulator hw button, so that part works. But CanGoBack is false, even if I ignore that and fire NavigateBackAsync nothing happens.
To see how new extension works with navigation I found that best example is commerce app in uno examples so I used that as a guideline.
In App.xml.cs I tried only first line or only second line , it doesn't make a difference , second line I found in commerce example :
//Host = await builder.NavigateAsync();
Host = await MainWindow.InitializeNavigationAsync(async () => builder.Build(), new MainPage());
I watched all techbites, all available documentation, but how navigations works "under the hood" is a mystery to me, will look at the source code of uno navigation extension later.
Also in commerce app I saw how to log debug details of navigation extension so here it is :
Beta Was this translation helpful? Give feedback.
All reactions