GraphicsDeviceExtensions.SetSharingMode Method

Hh221557.note(en-us,XNAGameStudio.41).gifNote
This method is available only when developing for Windows Phone.
Enables or disables sharing a graphics device between Silverlight and XNA.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Interop (in microsoft.xna.framework.interop.dll)

[ExtensionAttribute]
public static void SetSharingMode (
         GraphicsDevice device,
         bool enabled
)

Parameters

device
Type: GraphicsDevice
The graphics device to share.
enabled
Type: Boolean
Set to true to enable, and false to disable XNA rendering within a Silverlight application. XNA rendering is disabled by default for Silverlight applications.

SetSharingMode should be set to true before attempting to render with XNA, and should be set to false when rendering is completed, returning control of the graphics device to Silverlight.

Windows Phone

Community Additions

ADD
Show: