-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
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);
}