Skip to content

Docs(IRouteNotifier): show how to use route change correctly - #2915

Open
DevTKSS wants to merge 4 commits into
unoplatform:mainfrom
DevTKSS:docs-IRouteNotifier-implement-RouteChange
Open

Docs(IRouteNotifier): show how to use route change correctly#2915
DevTKSS wants to merge 4 commits into
unoplatform:mainfrom
DevTKSS:docs-IRouteNotifier-implement-RouteChange

Conversation

@DevTKSS

@DevTKSS DevTKSS commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #2663

PR Type

What kind of change does this PR introduce?

  • Documentation content changes

What is the current behavior?

The currently shown code sample is using e.Region?.Name which is most of the time I did use it in e.g. my root MainPage with a NavigationView null or empty or if it had a value, that was nothing near the Route/Region names set in the RegisterRoutes Route Map.

What is the new behavior?

as mentioned in the linked issue report to this, we need to use e.Navigator.Route?.ToString() in the event which is returning the Route Name then.

Showing this in a mvvm + mvux realistic usable sample along with Localization might also make this feature of uno easier to understand and implement in our apps.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs - my app runns on desktop target 👍
  • Docs have been added/updated which fit documentation template. (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Associated with an issue (GitHub or internal)

Other information

Users could also check out the video tutorial here, but as its only in german localization until now, I did not link it in the docs:
https://youtu.be/RZ3RirA7jhk

Internal Issue (If applicable):

Copilot AI review requested due to automatic review settings October 25, 2025 21:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR corrects and significantly expands the documentation for using IRouteNotifier in Uno Platform applications. The key improvement is fixing the incorrect route name access pattern (from e.Region?.Name to e.Navigator.Route?.ToString()), which was returning incorrect or null values.

Key changes:

  • Corrected the method for accessing the current route name using e.Navigator.Route?.ToString() instead of e.Region?.Name
  • Added comprehensive examples showing how to integrate IRouteNotifier with localization support for both MVVM and MVUX patterns
  • Reorganized content with numbered sections and clearer structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread doc/Learn/Navigation/Advanced/HowTo-IRouteNotifier.md
Comment thread doc/Learn/Navigation/Advanced/HowTo-IRouteNotifier.md
Comment thread doc/Learn/Navigation/Advanced/HowTo-IRouteNotifier.md
Comment thread doc/Learn/Navigation/Advanced/HowTo-IRouteNotifier.md
@DevTKSS
DevTKSS force-pushed the docs-IRouteNotifier-implement-RouteChange branch from 5ef6973 to 332a268 Compare December 11, 2025 20:59
@DevTKSS

DevTKSS commented Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

@kazo0 could we finalize this PR to get it released to the docs? the current sample is not working in at least MVUX Models in my apps, just copied that sample... 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IRouteNotifier + NavigationView + MVUX + Navigator not reliable?

2 participants