What is the RootFrame in a Windows Phone 7 application?
In the App.xaml.cs a new instance of PhoneApplicationFrame
is assigned to RootFrame.
RootFrame = new PhoneApplicationFrame(开发者_运维问答);
What does it do? Is the PhoneApplicationFrame something like the outermost container which contains all the pages? Is it the same for all pages? Or am I completely wrong...?
Yes you are right, that instance will be there as the root of the visual tree alive all the time. The individual PhoneApplicationPage instances will be set as Content of this frame by the Navigation framework.
A sample scenario : Suppose you want to use a header which need not change for individual pages then you can think about putting that inside the PhoneApplicationFrame's controltemplate so that header will be created only once and accessible/visible to all the pages.
You are right, the PhoneApplicationFrame is the outermost container on Windows Phone 7.
WPF applications have a window as it's outermost container, but for WP7 apps it's a Frame instead.
精彩评论