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: 0.0.0.0
Syntax
C#
public Color ClearColor { get; set; }

Property Value

Type: Color
Remarks

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