Click or drag to resize
CanvasVirtualControlClearColor Property
The color that the control is cleared to when CreateDrawingSession is called.

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public Color ClearColor { get; set; }

Property Value

Type: Color

ClearColor defaults to transparent black, that is, Color.FromArgb(0,0,0,0).

Modifying ClearColor will invalidate the entire control, as if Invalidate() was called.

CanvasVirtualControl uses this ClearColor property instead of the Background property that is inherited from XAML UserControl, because Background can be set to any XAML brush object. It does not make sense to clear an immediate mode Win2D control using XAML content as the background, so CanvasVirtualControl ignores the XAML Background setting.

See Also