Xamarin.Forms Shell Route Registration: Duplicate Route Key Behavior
0 reputation · 23 Mar 2023, 23:57 UTC
Xamarin.Forms Shell utilizes Routing.RegisterRoute to map string-based route keys to specific Page types. This registration typically occurs during application startup or Shell construction to ensure that navigation requests can be resolved globally across the application instance.
There is uncertainty regarding the internal resolution logic when the same route key is registered multiple times. Depending on the Xamarin.Forms version (e.g., 4.x vs 5.x), it is unclear if the framework throws a runtime exception, silently replaces the previous mapping, or fails to resolve the route entirely during a navigation call.
Does the Shell navigation engine prioritize the most recent registration for a duplicate route key, or does it maintain the initial mapping? What is the documented behavior for dynamic route re-registration after the initial Shell construction has completed?