Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How To Navigate Among Pages In UWP
WhatsApp
Umer Qureshi
9y
69.8k
0
1
100
Article
Here are the steps for Navigation in UWP,
Create a new UWP project
Go to add new item and add 3 'Blank Pages', page1, page 2 and page3 respectively as shown below,
Now add two stackpanels and a frame in it and name the frame to refer it later.
Add Home, Back and Forward buttons in the stackpanel and assign click events to them.
Go to the constructor of
MainPage.xaml.cs
and type
MyFrame.Navigate(typeof(Page1));
, So the first page loads as the application runs.
Copy the same code in home button click event.
Go to Page1.xaml and create a button and a textblock.
Go to Page2.xaml and create a button and a textblock.
Go to page2.xaml.cs click event and write Frame.Navigate(typeof(Page3));
Go to page1.xaml.cs click event and write Frame.Navigate(typeof(Page2));
Go to page3.xaml and create a textblock.
Now go to MainPage.xaml.cs and write the following code to make the navigation work.
Now run the program and see the navigation in work.
Source Code:
Navigation
Navigate among pages in UWP
UWP
Windows apps
Up Next
Ebook Download
View all
Printing in C# Made Easy
Read by 22.4k people
Download Now!
Learn
View all
Membership not found