Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

NavigationService GetNavigationService

<Page x: Class="NavigationApplication.Page3"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Page3" WindowTitle="Page3" Loaded="Init">   <StackPanel Margin="3" Name="pnl">     <TextBlock Margin="3" TextWrapping="Wrap">       This is a Page3.xaml.       Click <Hyperlink NavigateUri="Menu.xaml">here</Hyperlink> to go to the Menu.     </TextBlock>   </StackPanel> </Page> //File:Window.xaml.vb Imports System Imports System.Collections.Generic Imports System.Text Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Data Imports System.Windows.Documents Imports System.Windows.Input Imports System.Windows.Media Imports System.Windows.Media.Imaging Imports System.Windows.Navigation Imports System.Windows.Shapes Namespace NavigationApplication   Public Partial Class Page3     Inherits System.Windows.Controls.Page     Public Sub New()       InitializeComponent()     End Sub     Private Sub Init(sender As Object, e As EventArgs)       Dim nav As NavigationService = NavigationService.GetNavigationService(Me)       While nav.CanGoBack                End While     End Sub   End Class End Namespace