XNA Environment Initialization

When the Windows Phone XAML and XNA project template is used to create a Windows Phone 7.1 hybrid app, a region is generated within the App class for the purpose of initializing the XNA content manager and starting a GameTimer object. By default, a ContentManager is exposed as a public property within your App class, allowing it to be consumed across your application. You can, however, create new instances of the ContentManager class if you want.

When instantiating a ContentManager, it must be passed an IServiceProvider that can later be used to retrieve an IGraphicsDeviceService. The App class implements IServiceProvider, and the IServiceProvider.GetService method implementation returns objects that reside in the ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.