Click here to Skip to main content
15,888,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys,

I have a Xaml Page which has a Save Button on it.
In the code behind I have the Click event for the Save Button.

After the click logic is completed I want the page to be refreshed automatically.

How do I achieve that?


Thank you for all your help.
Chetan.
Posted
Updated 1-Sep-10 11:49am
v2
Comments
Dalek Dave 1-Sep-10 17:50pm    
Edited for Grammar and Readability.

What do you mean you want to refresh the page? Silverlight is not like HTML... there is no page refresh. If you have your data bound correctly, shouldn't the page instantly reflect the new data?
 
Share this answer
 
Comments
Dalek Dave 1-Sep-10 18:46pm    
There is an Autorefresh option, although 'I think' it is a complete reload of the page, inc silverlight code.
You could use a DispatcherTimer event.

see here[^]
 
Share this answer
 
Comments
AspDotNetDev 1-Sep-10 18:56pm    
Silverlight is like Flash. The UI in a silverlight application should be refreshed by updating the data, not by reloading the entire application. It would be like closing a Windows Form application and relaunching it to refresh the UI. It's not like ASP.NET where there is server code to be run... all the code runs on the client side, so doing a "postback" isn't necessary.
AspDotNetDev 1-Sep-10 18:57pm    
Also, why would a timer be required when the OP knows the event to refresh on (the button click)?
You need to call your web service everytime you need to do a refresh.

If you have implemented INotifyPropertyChanged correctly, you should be able to see data refreshed on the page everytime the service call returns to the client application (and your data has changed).
 
Share this answer
 
v2
HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900