Something about INavigationService in Silverlight

Mar 2, 2012 at 5:51 AM

I tried Catel.MVVM.Services.INavigationService in my silverlight app.

It's very good, but the result url is ugly and complex: http://localhost:4444/Default.aspx#/Views/AboutView.xaml

I don't know how much work must to do if I want the url of navigation service is like using UriMapper: http://localhost:4444/Default.aspx#About

Is it uncontrollable?

Coordinator
Mar 2, 2012 at 8:45 AM

Well, the navigation service simple calls this method when it is navigating:

System.Windows.Controls.Frame.Navigate(uri);

If I am not mistaken, that is exactly the same way that you should use it without MVVM. 

I think it is because the mappings are disabled in the templates, but I will have to find out why.

Coordinator
Mar 2, 2012 at 9:03 AM

ok, I have been thinking about extending the RootFrame url mappers automatically. However, this should be done carefully (because, how to deal with sub directories?).

What do you think of this:

  • /Views/AboutView.xaml => /About
  • /Documentation/Views/HowTo.xaml => /Documentation/HowTo

So basically, we strip:

  • .xaml
  • Views/ (and Pages/, UI/, etc)