Skip to content

[BUG] Views with umlauts or diacritics in it wont show up after calling RegionManager.RequestNavigate #3343

@Algorithman

Description

@Algorithman

Description

Views with umlauts or diacritics in the name (things which are totally permissible in c#) won't show up and are silently dropped.

Cause:
The view's name is converted into an URI (and therefore escaped in the process) but on navigation it is never unescaped.

Affected platforms: Probably all, it is a core function and Uri escape happens on all platforms the same way.

Steps to Reproduce

  • Create new prism app
  • add a new module
  • add a view in the new module with some umlauts (like TestäöüView)
  • try to navigate to it

Platform with bug

Prism WPF, Prism MAUI

Affected platforms

Windows, I was not able test on other platforms

Did you find any workaround?

Fix:
Unescape the Uri before returning it.

  protected virtual string GetContractFromNavigationContext(NavigationContext navigationContext)
  {
      if (navigationContext == null) throw new ArgumentNullException(nameof(navigationContext));

      var candidateTargetContract = UriParsingHelper.GetAbsolutePath(navigationContext.Uri);
      candidateTargetContract = candidateTargetContract.TrimStart('/');
      return Uri.UnescapeDataString(candidateTargetContract);
  }

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions