Click here to Skip to main content
15,123,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
NavigationService n = NavigationService.GetNavigationService(sender as Button);

n.Navigate(new Uri("SelectionPage.xaml", UriKind.Relative));


But I'm getting the following error:
VB
System.Windows.Navigation.NavigationService' does not contain a definition
for 'GetNavigationService'


Pls help me..
Posted
Updated 17-Jan-21 21:21pm
v2

Try this:

C#
this.NavigationService.Navigate(new Uri("SelectionPage.xaml", UriKind.Relative));
   
Comments
Rnshanmugavadivel 4-Mar-15 1:05am
   
I tried above code, i have following error message..

'Sample.Views.HomeView' does not contain a definition for 'NavigationService' and no extension method
'NavigationService' accepting a first argument of type 'Sample.Views.HomeView' could be found
(are you missing a using directive or an assembly reference?)
at mainwindow

use
partial class MainWindow: Page

instead
partial class MainWindow: Window
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900