Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to navigate from a wpf window to wpf page in C#(3.0)?

Tags:

c#

wpf

Hey i'm stucked here from last 3 days and tried as hell of possibilities, I have wpf window called 'Mainwindow.xaml' i want to navigate a wpf page named 'addNewTech.xaml' keeping 'Manwindow.xaml' open in background please help me out.. Thank you..

like image 632
user2067120 Avatar asked Nov 15 '25 17:11

user2067120


1 Answers

First. Add Frame in MainWindow.

For example:

Use this namespace xmlns:local="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"

<Grid>
   <local:Frame Name="MainFrame" NavigationUIVisibility="Hidden" >                            
   </local:Frame>
</Grid>

call AddNewTech in MainWindow.cs to load page into MainWindow.

MainFrame.Navigate(new Uri("addNewTech.xaml",UriKind.Relative));
like image 159
ebattulga Avatar answered Nov 17 '25 09:11

ebattulga