Click or drag to resize
CanvasAnimatedControlCustomDevice Property
Gets or sets an application-chosen device for this control.

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public CanvasDevice CustomDevice { get; set; }

Property Value

Type: CanvasDevice

Implements

ICanvasAnimatedControlCustomDevice
Remarks

Setting this property allows controls to use a CanvasDevice from arbitrary sources- for example, from Direct3D interop.

The default value for this property is null. This means that the control will obtain its devices from GetSharedDevice(Boolean) if UseSharedDevice is set. Otherwise, it will create its own new device each time.

Setting this property overrides the control's default device creation behavior, so the UseSharedDevice and ForceSoftwareRenderer properties are ignored.

One way to handle device lost while using a custom device, is to subscribe to the custom device's DeviceLost event. Then in the event handler, create a new device and assign it to CustomDevice.

See Also