PrismLibrary / PrismLibrary/Prism

[Enhancement] GetNavigationUriPath For Maui

Open
#3,092 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
6.8k
Forks
1.6k
Avg merge
2d 1h
Merged PRs (30d)
1

Description

Summary

In Prism Forms we had the extension method GetNavigationUriPath, which when called would give you the current Uri of the INavigationService. In maui this extension no longer exists and reading the current Uri from a Viewmodel is incredibly difficult. We can observe the current Uri using the global navigation observer, however performing viewmodel based logic on the current Uri path is difficult.

API Changes

Add a new INavigationServiceExtension method named GetNavigationUriPath

Intended Use Case

Performing logic in a view model based on the page uri stack. For example we could have a Login page which can be accessed in multiple ways:

  1. Open app for the first time, see a welcome flow & agree to privacy policy, complete flow and show login page. For this scneario we want to show a back button to go back into the privacy flow
  2. Open app after agreeing to privacy, go directly to the login page. In this case we don't want to show a back button because we are at the bottom of our navigation stack.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the MAUI navigation service and the INavigationServiceExtension methods, then compare them with Prism Forms' existing GetNavigationUriPath behavior. Implement the requested API so view models can read the current navigation URI path, and verify that it supports both navigation scenarios described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
mobile-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.