In This Article

Led Class

Represents a led control.

public class Led : CircularGaugeBase, ILogicalParent, IVisualParent
Inheritance:
object Visual UIElement FrameworkElement GaugeElement GaugeBase CircularGaugeBase object
Implements:
ILogicalParent IVisualParent

Remarks

For detailed documentation on this control's features and how to use them, please see the Gauge documentation topics.

Constructors

Led()

Initializes a new instance of the Led class.

public Led()

Properties

BlinkInterval

Gets or sets the interval used when LedState is set to Blinking, or when set to Off and the IsOffDelayEnabled feature is enabled. This is a dependency property.

public Duration BlinkInterval { get; set; }

Property Value

Duration:

The interval used when LedState is set to Blinking, or when set to Off and the IsOffDelayEnabled feature is enabled. The default value is 500 milliseconds.

IsLedEffectEnabled

Gets and sets a value indicating whether a special effect should be rendered for the led. This is a dependency property.

public bool IsLedEffectEnabled { get; set; }

Property Value

bool:

true if the led effect is enabled; otherwise, false. The default value is true.

IsOffDelayEnabled

Gets and sets a value indicating whether a BlinkInterval delay is applied before the led transitions from On to Off. This is a dependency property.

public bool IsOffDelayEnabled { get; set; }

Property Value

bool:

true if the delay is applied; otherwise, false. The default value is false.

LedBackground

Gets or sets the background brush, which is used to render the led light. This is a dependency property.

public Brush LedBackground { get; set; }

Property Value

Brush:

The background brush. The default value is DarkGray.

LedBorderBrush

Gets or sets the border brush, which is used to render the led light. This is a dependency property.

public Brush LedBorderBrush { get; set; }

Property Value

Brush:

The border brush. The default value is Black.

LedBorderThickness

Gets or sets the border thickness, which is used to render the led light. This is a dependency property.

public double LedBorderThickness { get; set; }

Property Value

double:

The border thickness. The default value is 1.

LedForeground

Gets or sets the foreground brush, which is used to render the led light. This is a dependency property.

public Brush LedForeground { get; set; }

Property Value

Brush:

The foreground brush. The default value is Red.

LedGeometry

Gets or sets a custom geometry used for the led light. This is a dependency property.

public Geometry LedGeometry { get; set; }

Property Value

Geometry:

A custom geometry used for the led light. The default value is null.

Remarks

This property is only used when LedType is set to LedType.CustomGeometry.

LedOffOpacity

Gets or sets the opacity of the led light when off. This is a dependency property.

public double LedOffOpacity { get; set; }

Property Value

double:

The opacity of the led light when off. The default value is 0.4.

LedOnOpacity

Gets or sets the opacity of the led light when on. This is a dependency property.

public double LedOnOpacity { get; set; }

Property Value

double:

The opacity of the led light when on. The default value is 1.0.

LedOpacity

Gets or sets the opacity used to render the led light. This is a dependency property.

protected double LedOpacity { get; set; }

Property Value

double:

The opacity used to render the led light. The default value is 0.0.

LedRadiusRatio

Gets or sets the radius of the led light as a ratio of the Radius property. This is a dependency property.

public double LedRadiusRatio { get; set; }

Property Value

double:

The radius of the led light as a ratio of the Radius property. The default value is 0.5.

LedState

Gets or sets the current state of the led light. This is a dependency property.

public LedState LedState { get; set; }

Property Value

LedState:

The current state of the led light. The default value is LedState.On.

LedType

Gets or sets the type of led light rendered. This is a dependency property.

public LedType LedType { get; set; }

Property Value

LedType:

The type of led light rendered. The default value is LedType.Circle.

Methods

OnCreateAutomationPeer()

Creates an appropriate LedAutomationPeer for this control as part of the WPF infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

An instance of LedAutomationPeer.

OnLedStateChanged(LedState, LedState)

Invoked when the LedState property is changed.

protected virtual void OnLedStateChanged(LedState oldValue, LedState newValue)
Parameter Type Description
oldValue LedState

The old property value.

newValue LedState

The new property value.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

RenderLed(DrawingContext)

Renders the led light based on various properties.

protected virtual void RenderLed(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing context.

UpdateLedOpacity()

Updates the LedOpacity, usually with an animation.

protected virtual void UpdateLedOpacity()

Events

LedStateChanged

Occurs when the LedState is changed.

public event EventHandler<LedStatePropertyChangedRoutedEventArgs> LedStateChanged

Event Type

EventHandler<LedStatePropertyChangedRoutedEventArgs>

Fields

BlinkIntervalProperty

Identifies the BlinkInterval dependency property. This field is read-only.

public static readonly DependencyProperty BlinkIntervalProperty

IsLedEffectEnabledProperty

Identifies the IsLedEffectEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsLedEffectEnabledProperty

IsOffDelayEnabledProperty

Identifies the IsOffDelayEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsOffDelayEnabledProperty

LedBackgroundProperty

Identifies the LedBackground dependency property. This field is read-only.

public static readonly DependencyProperty LedBackgroundProperty

LedBorderBrushProperty

Identifies the LedBorderBrush dependency property. This field is read-only.

public static readonly DependencyProperty LedBorderBrushProperty

LedBorderThicknessProperty

Identifies the LedBorderThickness dependency property. This field is read-only.

public static readonly DependencyProperty LedBorderThicknessProperty

LedForegroundProperty

Identifies the LedForeground dependency property. This field is read-only.

public static readonly DependencyProperty LedForegroundProperty

LedGeometryProperty

Identifies the LedGeometry dependency property. This field is read-only.

public static readonly DependencyProperty LedGeometryProperty

LedOffOpacityProperty

Identifies the LedOffOpacity dependency property. This field is read-only.

public static readonly DependencyProperty LedOffOpacityProperty

LedOnOpacityProperty

Identifies the LedOnOpacity dependency property. This field is read-only.

public static readonly DependencyProperty LedOnOpacityProperty

LedOpacityProperty

Identifies the LedOpacity dependency property. This field is read-only.

protected static readonly DependencyProperty LedOpacityProperty

LedRadiusRatioProperty

Identifies the LedRadiusRatio dependency property. This field is read-only.

public static readonly DependencyProperty LedRadiusRatioProperty

LedStateChangedEvent

Identifies the LedStateChanged routed event. This field is read-only.

public static readonly RoutedEvent LedStateChangedEvent

LedStateProperty

Identifies the LedState dependency property. This field is read-only.

public static readonly DependencyProperty LedStateProperty

LedTypeProperty

Identifies the LedType dependency property. This field is read-only.

public static readonly DependencyProperty LedTypeProperty

Inherited Members