I am learning a WPF tutorial from Microsoft website which is following:
I am getting the following error from my code:
private void Button_Click(object sender, RoutedEventArgs e)
{
//View Expense Report
ExpenseReportPage expenseReportPage = new ExpenseReportPage(); //Line 1
this.NavigationService.Navigate(expenseReportPage); // Line 2
}
Line 2 in above code gives following error for NavigationService:
'invalid-global-code' does not contain a definition for 'NavigationService' and no accessible extention method 'NavigationService' accepting the first argument of type '' could be found (are you missing a using directive or an assembly reference ?)
I have added the using System.Windows.Navigation; I think the problem is coming from 'this' part of this.NavigationService.Navigate(expenseReportPage);