Centralized navigation


  • Hello,

    For the several pages I have in my WP7 app, I want to centralize somewhere the navigation addresses. That is, to have something like this:

    * MainPage => /MainPage.xaml
    * MyListPage => /Views/MyListPage.xaml

    This info would be in a resource file (either XAML or RESX).

    Then have calls like this:

    <Custom:EventTrigger EventName="Click">
           <ic:NavigateToPageAction TargetPage="{Binding Source={StaticResource MyListPage}}"/>                     

    and in the code:

    NavigationService.Navigate(new Uri(MyNavigationResources.MyListPage, Urikind.Relative));

    Can you give me a suggestion of how doing this better? I would like to have all strongly typed, in order to resist to string typos.

    Btw, the XAML construct gives me an error: XamlParseException - AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 69 Position: 54]. I suspect the TargetPage attribute doesn't accept binding (?).

    Thank you in advance,
    Marius Z

    Tuesday, September 07, 2010 3:06 AM