Cross-Page Communication

,

After navigation has occurred, an opportunity remains for the previous page to interact with the current page from the previous page’s OnNavigatedFrom method. This is achieved using the Content property of the NavigationEventArgs, which provides the destination PhoneApplicationPage object.

To see this in action, place a breakpoint in the OnNavigatedFrom method. When the breakpoint is hit, notice that the page being navigated to has already been instantiated and is provided in the Content property of the NavigationEventArgs (see Figure 3.8).

Image

FIGURE 3.8 The Content property of the NavigationEventArgs contains the page being navigated to.

The Uri property of the NavigationEventArgs contains the URI of the destination page, including any query string that may be present.


Note

If navigating to an external URI, or when the app is being deactivated, the Uri property of the OnNavigatedFrom method’s NavigationEventArgs is equal to app://external/.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.184.223