Click or drag to resize
CanvasControlClearColor Property
The color that the control is cleared to before the Draw event is raised.

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 cause the control to redraw, as if Invalidate() was called.

CanvasControl 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 CanvasControl ignores the XAML Background setting.

See Also