-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Navigation] Page stack support when using Region.Attached="True"
#2604
Comments
Problem was the fact that when attempting to nav to something like the RecipeDetails route through something like a button click INSIDE of a region being driven by tabs/navview/etc., we would end up in a state where it would inject a FrameView as a child region of the PanelVisibilityNavigator and not do a full forward navigation at the root. So we would end up with something like this: So currently the logic for checking if the PanelVisibilityNavigator can execute the nav request is this: uno.extensions/src/Uno.Extensions.Navigation.UI/Navigators/PanelVisiblityNavigator.cs Lines 37 to 50 in 25d8eec
Last time, we discussed adding logic to determine if the route we are trying to nav to is defined as a named region that is a child of the current Region, otherwise it should let the nav request bubble up further to the root navigator. We actually seem to already be doing that check here: uno.extensions/src/Uno.Extensions.Navigation.UI/Navigators/PanelVisiblityNavigator.cs Line 49 in 25d8eec
Problem is, we don't hit that check because this evals to true: uno.extensions/src/Uno.Extensions.Navigation.UI/Navigators/PanelVisiblityNavigator.cs Lines 42 to 45 in 25d8eec
So basically if there is a valid RenderView for the route, it will always inject that view and nav to the requested region within that. Which is why we see the RecipeDetails page nested inside of the Favorites page underneath the Top TabBar. Our thinking is that it should only inject the resolved RenderView if and only if the routeMap param that represents the route we are navigating to is a direct nested route of our current Region's root route. So, in our RecipeDetails example above, the RecipeDetails route is a sibling route of the current FavoriteRecipes route: so if the detected route is not nested within FavoriteRecipes, we should be navigating at a higher level than the PanelVisibilityNavigator attached to the TabBar. Does this make sense? because there are three situations we need to cover that would result in doing a nested nav where the PanelVisibilityNavigator's RegionCanNavigate return true:
And RegionCanNavigate should return false when:
|
Current behavior
In a typical navigation flow with Uno.Extensions.Navigation, where
MainPage
is a standard page (withoutNavigationView
orTabBar
), navigating toSecondPage
successfully builds a navigation stack. This allows returning toMainPage
without needing to specify aDependsOn: "Main"
inSecondPage
'sRouteMap
.However, when using
NavigationView
orTabBar
inMainPage
, along with a<Grid uen:Region.Attached="True" uen:Region.Navigator="Visibility" />
to render pages, specifyingDependsOn
in theRouteMap
becomes necessary to maintain the page stack and enable back navigation.So if we have a page that can be navigated to from multiple pages, defining multiple
RouteMap
s for that page becomes necessary.Expected behavior
How to reproduce it (as minimally and precisely as possible)
Environment
Nuget Package (s):
Package Version(s):
Affected platform(s):
The text was updated successfully, but these errors were encountered: