Implement Silverlight with multiple XAML page navigation (the class of this XAML corresponds to the class inherited from the page)ProgramYou will often encounter the problem of how to refresh the current XAML page. Note: refresh the current XAML page instead of the entire host ASPX page! The latter can be implemented by calling Javascript, for example: (remember to reference the namespace using system. Windows. browser ;)
Htmlwindow window = htmlpage. Window; <br/> window. navigate (New uri ("mytestpage. aspx", urikind. Relative ));
For the former, for example, my project has a testpage inherited from the page class. on the XAML page, I set it to the startup page when Silverlight is loaded. How can I refresh the XAML page instead of the whole host ASPX page? I first thought of using the this. navigationservice. Refresh () method in the testpage class, but this method does not play any role .. Not refreshed. Next we thought of the refresh method in the frame. This method is indeed feasible, but the architecture of this page class should be changed again. For example, create another homepage. on the XAML homepage, place a frame control named frame1 and set its source attribute to "/testpage. ", and then you can call the refresh method in the parent container frame1 in testpage to refresh.