Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use an XML file to write a value that says whether or not the page has already been displayed. So in this page's constructor (or more appropriately in it's OnLoad event) you can write the value to the XML file and say it's already been displayed. Then in your startup logic you can read this file and if that value has already been set, you can skip to a different page.</p> <p>Xml File</p> <pre><code>&lt;StartupValues&gt; &lt;HasFirstTimePageDisplayed&gt;True&lt;/HasFirstTimePageDisplayed&gt; &lt;/StartupValues&gt; </code></pre> <p>Page-You-Want-To-Show-Once</p> <p>Xaml</p> <pre><code>&lt;Page Loaded="OnLoaded" ... /&gt; </code></pre> <p>Xaml.Cs</p> <pre><code>public void OnLoaded( object sender, RoutedEventArgs args ) { var xml = new XmlSerializer( typeof( StartupValues ) ); using( var writer = new StreamWriter( "config_file_path_here.xml" ) ) { xml.Serialize( new StartupValues { HasFirstTimePageDisplayed = true }, writer.BaseStream ); } } </code></pre> <p>App.xaml.cs</p> <pre><code>public void OnStartup( ... ) // I forget what the method signature for this is { bool displayFirstPage = true; var xml = new XmlSerializer( typeof( StartupValues ) ); using( var reader= new StreamReader( "config_file_path_here.xml" ) ) { StartupValues values = xml.Deserialize( reader.BaseStream ) as StartupValues; displayFirstPage = values.HasFirstTimePageDisplayed; } if( displayFirstPage ) { // display the page } else { // display a different page } } </code></pre> <p>StartupObject.cs</p> <pre><code>public class StartupValues { public bool HasFirstTimePageDisplayed { get; set; } } </code></pre> <p>Some reading material relating to your problem:</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" rel="nofollow">XmlSerializer</a> Class</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.io.streamreader.aspx" rel="nofollow">StreamReader</a> Class</p> <p><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff626521%28v=vs.105%29.aspx" rel="nofollow">Page Navigation in WP8 Apps</a></p> <p><a href="http://developer.windowsphone.com/en-us" rel="nofollow">WP8 Dev Center</a> (A great place for resources)</p>
    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