WPF-005: Use of KeepAlive in the PageFunction navigation

Source: Internet
Author: User

For Page navigation, you can directly use this. NavigationService. Navigate (New Page Object, parameter (optional), but to better process the returned results. It is best to use the Page that inherits PageFunction <T> to navigate and process the Return of a Page in the Return event. Note: 1. default constructor and constructor with parameters. If KeepAlive is not set, the constructor is called again when the new page is returned, and the default value is called. 2. When there is only one constructor with parameters, there is only one constructor with parameters, and KeepAlive is not set. When a new page returns (OnReturn), an exception is reported: you have not set the object reference to the instance of the object. 1. When using constructors with parameters, you must set KeepAlive = true on this page. 2. It is best to have only one default constructor for a page. The parameter is passed when you Navigate to the page (this. NavigationService. Navigate (New Page Object, parameter (optional ))). However, when KeepAlive = true is set, pay attention to the values that need to be processed at the time of return. Otherwise, the old data will affect the data on the current interface.

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.