In This Article

Led Light

Led supports on, off, or blinking states, and includes several options for customizing the look of the LED light.

State

The LED light can be in one of three states (on, off, or blinking), which is set using the LedState property.

ScreenshotScreenshot

Two Led controls with the LED light on (left) and off (right)

When blinking, the light will be toggle between on and off at the interval specified by the BlinkInterval property.

Delaying the Off State Transition

When a LED light is quickly toggling on and off, it may be distracting. The IsOffDelayEnabled property can be set to true to introduce a delay when transitioning from the On to Off state. This allows a temporary On signal to keep the LED lit a little longer than what its real state would normally allow. The delay is governed by the value of the BlinkInterval property.

Appearance

Light Shape

The LED light defaults to a circle, but supports several shapes including arrows, triangles, rectangles, etc. The LED light type is specified using the LedType property.

Screenshot

Led using an arrow that points down for the LED light

When the built-in LED types are not flexible enough to achieve the desired look, a custom Geometry can be used.

When LedType is set to CustomGeometry, then the Geometry specified by LedGeometry is used when rendering the LED light.

Light Size

The size of the LED light is control by the LedRadiusRatio property, which is defined as a percentage of the Radius.

Note

When using an LED light that is not circular, the associated shape is sized such that it would fit inside a circle with the associated radius computed from LedRadiusRatio and Radius.

ScreenshotScreenshot

Two Led controls with an LED radius ratio of 80% (left) and 60% (right)

Brush and Effect

The LED background and foreground colors can be customized by setting the LedBackground and LedForeground, respectively. The LED effect can be disabled entirely by setting IsLedEffectEnabled to false.

ScreenshotScreenshot

Two Led controls with a red light; the right image has the LED effect disabled

Important

The LED effect is only supported when IsLedEffectEnabled is set to true and LedBackground/LedForeground are set to a SolidColorBrush.

The LedState of the Led determines how the foreground of the light is rendered, but regardless of the state the LED light background is rendered using the LedBackground brush. Using the LedState, the LED light foreground is rendered on top of the background, using a varying opacity. If the light is On, then LedOnOpacity is used. If the light is Off, then LedOffOpacity is used. If the light is Blinking, then the opacity is animated to and from LedOnOpacity and LedOffOpacity.

By default, the LED light includes a thin black border, but this can be customized by setting the LedBorderBrush and/or LedBorderThickness appropriately.

Value Converters

A value converter, that can be used in data binding, is provided to convert between Boolean and LedState types. See the Advanced Features\Converters topic for more information.