madhavi kothary

madhavi kothary

  • NA
  • 1
  • 1.1k

WPF Navigation

Dec 1 2014 1:36 AM
How to navigate from window.xam to page.xaml in wpf using C# code on button click??
I am struggling with with this from last 3 days??
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Width="350">
<Button x:Name="Ok" Content="OK" Margin="10" Height="35" Width="97" Opacity="0.5" FontSize="20" Click="Ok_Click" ></Button>
<Button x:Name="Cnncel" Content="Cancel" Margin="10" Height="35" Width="97" Opacity="0.5" FontSize="20"></Button>
</StackPanel>
 
 
---------------
private void Ok_Click(object sender, RoutedEventArgs e)
{
// Page2 p = new Page2();
//p.NavigationService.Navigate(this);
// NavigationService nav = NavigationService.GetNavigationService(this);
//nav.Navigate(new System.Uri("Page2.xaml", UriKind.RelativeOrAbsolute));
//Page2 p2 = new Page2();
//nav.Navigate(p2);
// Window obj = new Window();
//_mainFrame.NavigationService.Navigate(new Page2());
////_mainFrame.Navigate(new Page2());
}
 

Answers (1)