Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do this by setting a dummy page as the main page of your project. You can change the main page by editing the WMAppManifest.xml file of your project:</p> <pre class="lang-xml prettyprint-override"><code>&lt;DefaultTask Name="_default" NavigationPage="DummyPage.xaml" /&gt; </code></pre> <p>Now, detect all navigations directed to the dummy page, and redirect to whichever page you want.</p> <p>To do this, in the App.xaml.cs file, at the end of the constructor, subscribe to the 'Navigating' event:</p> <pre class="lang-cs prettyprint-override"><code>this.RootFrame.Navigating += this.RootFrame_Navigating; </code></pre> <p>In the event handler, detect if the navigation is directed to the dummy page, cancel the navigation, and redirect to the page you want:</p> <pre class="lang-cs prettyprint-override"><code>void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e) { if (e.Uri.OriginalString == "/DummyPage.xaml") { e.Cancel = true; var navigationService = (NavigationService)sender; // Insert here your logic to load the destination page from the isolated storage string destinationPage = "/Page2.xaml"; this.RootFrame.Dispatcher.BeginInvoke(() =&gt; navigationService.Navigate(new Uri(destinationPage, UriKind.Relative))); } } </code></pre> <p><strong>Edit</strong></p> <p>Actually, there's even easier. at the end of the app constructor, just set a UriMapper with the replacement Uri you want:</p> <pre class="lang-cs prettyprint-override"><code>var mapper = new UriMapper(); mapper.UriMappings.Add(new UriMapping { Uri = new Uri("/DummyPage.xaml", UriKind.Relative), MappedUri = new Uri("/Page2.xaml", UriKind.Relative) }); this.RootFrame.UriMapper = mapper; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload