aman shivhare
aman shivhare

Reputation: 334

How to reload or refresh a Windowsphone User Control in c#?

I am making a windowsphone silverlight App for windowsphone OS 8. I am Using windowsphone user controls where I make changes dynamically. My question is just like the way we create an instance of a phoneApplication Page for Normal .xaml Page using NavigationService.Navigate("Source Uri with unique GUID") . How can I achieve the same effect for a windowsphone User Control Page where I make my dynamic changes to update as there is no Navigation Service.Navigate() method available. ? Currently I have to Navigate like UserControl-Page-UserControl

Upvotes: 0

Views: 467

Answers (1)

Pradeep AJ- Msft MVP
Pradeep AJ- Msft MVP

Reputation: 600

When you want to Navigate from a page, you can use NavigationService.Navigate().

When you want to Navigate from a UserControl, You can use the PhoneApplicationFrame to navigate.

Code Sample:

(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/MyProjectName;component/MyFolderName/MyPage.xaml", UriKind.Relative)); 

You need to append a GUID when you want to navigate to a new instance of the same page which you are currently residing.

Upvotes: 1

Related Questions