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

Constructors

Led()

Initializes an instance of the class.

public Led()

Properties

BlinkInterval

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

public Duration BlinkInterval { get; set; }

Property Value

Duration:

The default value is 500 milliseconds.

IsLedEffectEnabled

Indicates whether a special effect should be rendered for the LED.

public bool IsLedEffectEnabled { get; set; }

Property Value

bool:

The default value is true.

IsOffDelayEnabled

Indicates whether a BlinkInterval delay is applied before the LED transitions from On to Off.

public bool IsOffDelayEnabled { get; set; }

Property Value

bool:

The default value is false.

LedBackground

The background brush, which is used to render the LED light.

public Brush? LedBackground { get; set; }

Property Value

Brush:

The default value is DarkGray.

LedBorderBrush

The border brush, which is used to render the LED light.

public Brush? LedBorderBrush { get; set; }

Property Value

Brush:

The default value is Black.

LedBorderThickness

The border thickness, which is used to render the LED light.

public double LedBorderThickness { get; set; }

Property Value

double:

The default value is 1.

LedForeground

The foreground brush, which is used to render the LED light.

public Brush? LedForeground { get; set; }

Property Value

Brush:

The default value is Red.

LedGeometry

A custom geometry used for the LED light.

public Geometry? LedGeometry { get; set; }

Property Value

Geometry

Remarks

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

LedOffOpacity

The opacity of the LED light when off.

public double LedOffOpacity { get; set; }

Property Value

double:

The default value is 0.4.

LedOnOpacity

The opacity of the LED light when on.

public double LedOnOpacity { get; set; }

Property Value

double:

The default value is 1.0.

LedOpacity

The opacity used to render the LED light.

protected double LedOpacity { get; set; }

Property Value

double:

The default value is 0.0.

LedRadiusRatio

The radius of the LED light as a ratio of the Radius property.

public double LedRadiusRatio { get; set; }

Property Value

double:

The default value is 0.5.

LedState

The current state of the LED light.

public LedState LedState { get; set; }

Property Value

LedState:

The default value is On.

LedType

The type of led light rendered.

public LedType LedType { get; set; }

Property Value

LedType:

The default value is Circle.

Methods

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer? OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

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.

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

Defines the BlinkInterval property.

public static readonly DependencyProperty BlinkIntervalProperty

IsLedEffectEnabledProperty

Defines the IsLedEffectEnabled property.

public static readonly DependencyProperty IsLedEffectEnabledProperty

IsOffDelayEnabledProperty

Defines the IsOffDelayEnabled property.

public static readonly DependencyProperty IsOffDelayEnabledProperty

LedBackgroundProperty

Defines the LedBackground property.

public static readonly DependencyProperty LedBackgroundProperty

LedBorderBrushProperty

Defines the LedBorderBrush property.

public static readonly DependencyProperty LedBorderBrushProperty

LedBorderThicknessProperty

Defines the LedBorderThickness property.

public static readonly DependencyProperty LedBorderThicknessProperty

LedForegroundProperty

Defines the LedForeground property.

public static readonly DependencyProperty LedForegroundProperty

LedGeometryProperty

Defines the LedGeometry property.

public static readonly DependencyProperty LedGeometryProperty

LedOffOpacityProperty

Defines the LedOffOpacity property.

public static readonly DependencyProperty LedOffOpacityProperty

LedOnOpacityProperty

Defines the LedOnOpacity property.

public static readonly DependencyProperty LedOnOpacityProperty

LedOpacityProperty

Defines the LedOpacity property.

protected static readonly DependencyProperty LedOpacityProperty

LedRadiusRatioProperty

Defines the LedRadiusRatio property.

public static readonly DependencyProperty LedRadiusRatioProperty

LedStateChangedEvent

Defines the LedStateChanged routed event.

public static readonly RoutedEvent LedStateChangedEvent

LedStateProperty

Defines the LedState property.

public static readonly DependencyProperty LedStateProperty

LedTypeProperty

Defines the LedType property.

public static readonly DependencyProperty LedTypeProperty

Inherited Members

Extension Methods