Skip to content
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

IRouteNotifier + NavigationView + MVUX + Navigator not reliable? #2663

Open
10 of 16 tasks
DevTKSS opened this issue Jan 13, 2025 · 0 comments
Open
10 of 16 tasks

IRouteNotifier + NavigationView + MVUX + Navigator not reliable? #2663

DevTKSS opened this issue Jan 13, 2025 · 0 comments
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@DevTKSS
Copy link

DevTKSS commented Jan 13, 2025

Current behavior

Listening to RouteNotifier as described in uno docs from MainModel as corresponding Model to MainPage where the apps NavigationView is placed, the output is case 1 empty string or case 2 "Tab" indicating the TabNavigationBar ib the bottom of this app, but never showing any of the route names in Route registry or xaml named regions.

Expected behavior

If that output would be the current route as expected it would maybe be possible to set the NavigationView Header Content to that Page Title=Route to not havong to add a header definition to each of them

How to reproduce it (as minimally and precisely as possible)

  1. Create a app using mvux, regions, DI with recommended template
  2. Set app.xaml.cs Route Registry:
    ViewMap s for at least 3 pages incl. Their models, so add one
  3. RouteMap:
    Main is nested to shell, second and third page nested to main, second to be default, same as main.
  4. Clear each pages current content
  5. Add NavigationView to MainPage, incl Region.Attached = true
  6. Add at least two menuitems NavigationViewItem s and add Region.Name to each of them to show the correct selection corresponding to shown content
  7. On the NavigationView properties place CommandExtensions.Command bound to MainModel to cantral navigation handler
  8. If you like to get some "Tab" output, add a TabNavigationBar with named Regions
  9. Add some simple content to the second and third page like a textblock with its name
  10. Install the IRouteNotifier exactly as told in documentation
  11. on route change let it set this text to MainModel IState<string>CurrentHeaderText
  12. bind this to the NavigationView.Header

Start and check it out. No header will be there

Environment

Nuget Package (s):

Package Version(s):

Affected platform(s):

  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Android
  • WebAssembly
  • Windows
  • Skia (WPF)
  • Skia (GTK on Linux/macOS/Windows)
  • Skia (Linux Framebuffer)
  • Build tasks

Visual Studio:

  • 2019 (version: )
  • 2022 (version: latest)
  • Visual Studio Code (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Would be nice to be able to set the NavigationView.Header to the current pages header or similar to not have to set this up at each page individually. On wpf or similar pages do have Title property to fill this in, on uno that is at least not available on intellisense...

@DevTKSS DevTKSS added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

1 participant