Поделиться через


XNA Framework and Silverlight

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This topic describes support for XNA Framework applications in the .NET Framework Class Library for Silverlight. XNA Framework applications on Windows Phone OS 7.1 depend on types and members supported in the .NET Compact Framework. Both Silverlight for Windows Phone and XNA Framework for Windows Phone are dependent on the .NET Compact Framework, so most of the supported types and members are the same. Some types and members available on other platforms might not be available on Windows Phone OS 7.1.

If you are migrating existing XNA Framework applications to Windows Phone, you can re-use most of your application code in Visual Studio 2010 Express for Windows Phone by first creating an XNA Framework project template that targets Windows Phone. When you are working in Visual Studio 2010 Express for Windows Phone, IntelliSense shows only those members that are supported by XNA Framework. For additional information, see Developing Windows Phone Games.

Using the Reference Documentation

The .NET Framework Class Library for Silverlight reference documentation provides information about types and members that are supported in XNA Framework. Use any of the following methods to find information related to XNA Framework support.

  • Check the Version Information section in individual reference topics. For types and members present in XNA Framework, there is a Windows Phone entry under XNA Framework. The following illustration shows an example of the Version Information section for IDictionary.

    Version Information section

  • Look for Windows Phone icons in member page lists. To see an example of a member page list that contains these icons, see HttpWebRequest. The following illustration shows an example of the Windows Phone icon.

    Silverlight for Windows Phone

    Important noteImportant Note:

    The types in the System.Windows.namespace namespaces contain the Windows Phone icon, but are not supported in a XNA Framework for Windows Phone project unless you create a project that renders both Silverlight and XNA Framework content. For more information, see the next section "Combining Silverlight and XNA Framework Content." Two exceptions are the IsolatedStorageSettings class and some methods of the System.Windows.Application object. These members do not show the correct XNA Framework for Windows Phone versioning information in the reference documentation, but can be used from an XNA Framework application.

    Important noteImportant Note:

    For a few members, the member may be present in XNA Framework for Windows Phone but not supported. For complete information, look at the Silverlight for Windows Phone version notes, which also apply to XNA Framework for Windows Phone, at the end of the Remarks section in the reference topic for that member.

  • For behavior and support information specific to Windows Phone, look for Silverlight for Windows Phone version notes at the end of the Remarks section in individual reference topics. Also, see Implementation Differences Between Silverlight and Silverlight for Windows Phone.

Combining Silverlight and XNA Framework Content

You can add create an application that renders both Silverlight and XNA Framework content by using the templates provided with the Windows Phone SDK. For more information about how to use the templates, see Using the Silverlight and XNA Project Templates and How to: Combine Silverlight and the XNA Framework in a Windows Phone Application.