A light element that inherits from LightVisualElement, adds the base states for theming and sets the default event to Click.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class LightVisualButtonElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementLightVisualButtonElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a button element with mouse capture enabled while it is pressed.
public LightVisualButtonElement()
Fields
Identifies the active state used for pressed feedback during mouse or keyboard activation, or pointer entry in hover click mode.
public static RadProperty IsPressedProperty
Properties
Gets a value indicating whether the LightVisualButtonElement is in pressed state.
[Browsable(false)]
public virtual bool IsPressed { get; }
SvgColorElementsSelector
Func<RadSvgImage, IEnumerable<SvgElement>>
Gets or sets the selector used to locate the SvgElement instances
whose fill color should be synchronized with the element's ForeColor.
When null, the first SvgPath in the document is used.
Assign a custom selector to reuse the color synchronization for different SVG structures.
[Browsable(false)]
[CLSCompliant(false)]
public Func<RadSvgImage, IEnumerable<SvgElement>> SvgColorElementsSelector { get; set; }
Methods
Enables mouse capture on press so the element can track the release even if the pointer moves.
protected override void InitializeFields()
Overrides:
Treats an enabled double-click as a click; disabled elements do not raise the click.
Uses Space to press the button, Enter to activate it immediately, and Escape to cancel a press.
protected override void OnKeyDown(KeyEventArgs e)
The key data for the pressed key.
Overrides:
Activates the button when Space is released after a press.
protected override void OnKeyUp(KeyEventArgs e)
The key data for the released key.
Overrides:
Sets the pressed state on a left-button press unless the element uses hover click mode.
protected override void OnMouseDown(MouseEventArgs e)
The mouse-button and location data for the press.
Overrides:
Sets the pressed state when hover click mode is active or a captured press returns to the element.
protected override void OnMouseEnter(EventArgs e)
The event data for the pointer entering the element.
Overrides:
Clears the pressed state on pointer exit and records a pending press when the pointer is captured.
protected override void OnMouseLeave(EventArgs e)
The event data for the pointer leaving the element.
Overrides:
Clears mouse-down state and, outside hover click mode, releases the pressed state.
protected override void OnMouseUp(MouseEventArgs e)
The mouse-button and location data for the release.
Overrides:
Clears the pressed state when the element is disabled and synchronizes SVG fills when its foreground color changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Overrides:
Synchronizes the fill color of the SVG elements returned by the SvgColorElementsSelector with the current ForeColor.
public void SyncSvgColor()