Skip to main content

Control Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

Base class for focusable UI controls with background, foreground and font.

public class Control : UIElement

Properties

TabIndex

public int TabIndex { get; set; }

Lower values are visited first by Input.FocusNavigator.

IsTabStop

public bool IsTabStop { get; set; }

When false, this control is skipped for keyboard focus navigation.

ShowFocusVisual

public bool ShowFocusVisual { get; set; }

When true and the control has focus, a focus rectangle is drawn.

DataContext

public object DataContext { get; set; }

Optional data context for lightweight binding (e.g. TextBox.SetTextBinding).

Background

public Media.Brush Background { get; set; }

The brush used to paint the control's background.

Font

public System.Drawing.Font Font { get; set; }

The font used by the control's text.

Foreground

public Media.Brush Foreground { get; set; }

The brush used to paint the control's foreground content.

Methods

OnRender(DrawingContext dc)

public override void OnRender(DrawingContext dc)

Draws the background and, when focused, the focus rectangle.

SolidColorBrush( Colors.Black)

protected internal Media.Brush _foreground = new SolidColorBrush(Colors.Black)

Backing field for the control's foreground brush.

Returns Media.Brush _foreground = new

Fields

_background

protected internal Media.Brush _background

Backing field for the control's background brush.

_font

protected internal System.Drawing.Font _font

Backing field for the control's font.