Click or drag to resize
CanvasDeviceIsDeviceLost Method
Returns whether this device has lost the ability to be operational.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public bool IsDeviceLost(
	int hresult
)

Parameters

hresult
Type: SystemInt32

Return Value

Type: Boolean
Remarks

This method expects an error code from an exception that your app has caught. IsDeviceLost will return true if the device is indeed lost, and the error code actually corresponds to device removal.

This is intended to be used like:

try { DrawStuff(); }
catch (Exception e) where canvasDevice.IsDeviceLost(e.ErrorCode)
{
    canvasDevice.RaiseDeviceLost();
}

For more information, see Handling device lost.

See Also