Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here the sample example for your question : </p> <p>What i am creating : 2 pages... You will have (go to page 2)link on page 1...If u click that,the second page should appear that says "Page 2" at the top. Notice that there is a back button to the left of the page title. Click the button to return to the first page...</p> <p>1.) Find the TextBlock element named pageTitle and change the Text property to Page 1. The XAML should look like this:</p> <pre><code>&lt;TextBlock x:Name="pageTitle" Grid.Column="1" Text="Page 1" Style="{StaticResource PageHeaderTextStyle}"/&gt; </code></pre> <p>2.)Add the following XAML as a second child element to the root Grid. The StackPanel element should be a sibling to the Grid that contains the back button and page title.</p> <pre><code>&lt;StackPanel Grid.Row="1" Margin="120,0,120,60"&gt; &lt;HyperlinkButton Content="Click to go to page 2" Click="HyperlinkButton_Click_1"/&gt; &lt;/StackPanel&gt; </code></pre> <p>3.)Make the following changes to BasicPage2.xaml. Find the TextBlock element named pageTitle and change the Text property to Page 2. The XAML should look like this:</p> <pre><code>&lt;TextBlock x:Name="pageTitle" Grid.Column="1" Text="Page 2" Style="{StaticResource PageHeaderTextStyle}"/&gt; </code></pre> <p>4.)Add the following XAML as a second child element to the root Grid. The StackPanel element should be a sibling to the Grid that contains the back button and page title.</p> <pre><code>&lt;StackPanel Grid.Row="1" Margin="120,0,120,60"&gt; &lt;TextBlock HorizontalAlignment="Left" Name="tb1" Text="Hello World!"/&gt; &lt;/StackPanel&gt; </code></pre> <p>5.)Add the following code to the BasicPage1 class in BasicPage1.Xaml.cs</p> <pre><code>private void HyperlinkButton_Click_1(object sender, RoutedEventArgs e) { this.Frame.Navigate(typeof(BasicPage2)); } </code></pre> <p>6.)Now that we've prepared the new pages, we need to make BasicPage1 the first thing that appears when the app starts. Open app.xaml.cs and change the OnLaunched method to call Frame.Navigate by using BasicPage1 instead of the BlankPage. The entire OnLaunched method should look like the following:</p> <pre><code>protected override void OnLaunched(LaunchActivatedEventArgs args) { // Create a Frame to act navigation context and navigate to the first page var rootFrame = new Frame(); rootFrame.Navigate(typeof(BasicPage1)); // Place the frame in the current window and ensure that it is active Window.Current.Content = rootFrame; Window.Current.Activate(); } </code></pre> <p>Now you are ready to test the app. Start the app, and click the link that says Click to go to page 2. The second page should appear that says "Page 2" at the top. Notice that there is a back button to the left of the page title. Click the button to return to the first page. Thats it! hope it helps u.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. 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