In Navigation API of Silverlight 3 the UriMapper class is case sensitive. For the following uri mapping
<nav:Frame Source="/Home">
<nav:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping
Uri=""
MappedUri="/Views/HomePage.xaml"/>
<uriMapper:UriMapping
Uri="/entity/{code}"
MappedUri="/Views/EntityEditorPage.xaml?code={code}"/>
<uriMapper:UriMapping
Uri="/{pageName}"
MappedUri="/Views/{pageName}Page.xaml"/>
</uriMapper:UriMapper>
</nav:Frame.UriMapper>
</nav:Frame>
the "/entity/123" is correctly mapping to "/Views/EntityEditorPage.xaml?code=123" but "/Entity/123" will fail with the "/Views/Entity/123Page.xaml not found" exception.
How can I turn the UriMapper to case-insensitive?
Thanks.
Safor,
I did exactly what Anthony suggested for my own application.
Here is your XAML modified to use a CustomUriMapper:
Here is the code for the CustomUriMapping and the CustomUriMapper classes:
Good luck, Jim McCurdy
You can't do this easily. Ultimately you will need to derive your own
UriMapperBase
and do all the mapping logic yourself. Its probably not a worthwhile thing to do unless you can use some simplified mappings.UriMapper uses regular expression try changing your mapping to "[V|v]iews/EntityEditorPage.xaml?code={code}" for starters this will make the V in view case insensi