Reputation: 38190
Windows phone template creates MainPage class but I can't see where it instantiates it anywhere in source code ?
So how does it work internally ?
Update: In Silverlight, Instantiation can be done in application startup, what would be the equivalent in Windows Phone ?
Upvotes: 1
Views: 149
Reputation: 3217
The PhoneApplicationPage
is a control
. Yes, when you navigate to the page, object for the Page
is internally created. You can, of course, refer to them in their namespaces, as with any other control. Like with any other framework, some things are taken care of, by the framework.
Upvotes: 1
Reputation: 13837
The only place I could find it was within the WMAppManifest.xml file. I would assume that the OS uses that to navigate to the MainPage when the app is launched.
<Tasks>
<DefaultTask Name ="_default" NavigationPage="MainPage.xaml"/>
</Tasks>
Upvotes: 2