CanvasVirtualControlCustomDevice Property |
Namespace: Microsoft.Graphics.Canvas.UI.Xaml
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.