When the program starts up, MainPage is displayed. The XAML file contains XML namespace declarations for “controls” (to access the Pivot control) and “local” (for MusicPresenter). The Resources collection instantiates MusicPresenter:
Example 18-12. Silverlight Project: MusicByComposer File: MainPage.xaml (excerpt)
<phone:PhoneApplicationPage.Resources> <local:MusicPresenter x:Key="musicPresenter" /> </phone:PhoneApplicationPage.Resources>
In the design view, Visual Studio will complain that it can’t create an instance of MusicPresenter, and of course it can’t because it would need access to the phone’s (or the phone emulator’s) music library.
Almost the entire visual tree of the page is a Pivot control:
Example 18-13. Silverlight ...