Specify Popup location, throughout page navigation

后端 未结 3 1062
难免孤独
难免孤独 2021-01-21 06:42

Hello I have an issue with positioning a popup, in a WP8 app.

My code is that I have instantiated a popup, where the child is a usercontrol, like:

Popup          


        
3条回答
  •  离开以前
    2021-01-21 07:19

    This is not possible in Windows Phone 8. It would be possible in WinRT 8.1. The reason is that you need to go up further than the control where the navigation occurs, and that is the PhoneApplicationFrame for Windows Phone 8. Per the documentation:

    Frames

    A frame integrates with the Windows Phone look and feel so that it appears like any other application. Only a single frame is available to the application with no exceptions. A frame includes the following characteristics:

    •Exposes properties from a hosted page such as screen orientation

    •Exposes a client area where pages are rendered

    •Exposes a NavigationService that facilitates navigating between pages

    •Reserves space for the status bar and Application Bar

    If you could go above the PhoneApplicationFrame and host multiple PhoneApplicationFrames, you could put some XAML into it that would allow you to interact with multiple Frames and place something in between the page navigations. However, you can't in Silverlight 8.0. In face, the RootFrame does not have a parent, so you can't even make any other control it's sibling.

    If you're willing to build your own navigation service (which I don't recommend), you can simulate this within a single page using UserControls.

提交回复
热议问题