[Silverlight Study Notes] Page refresh

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.