In This Article

BarButtonLink Class

Represents a bar button command link.

[TypeConverter(typeof(BarButtonLinkConverter))]
public class BarButtonLink : BarCommandLink, IInputElement, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, IImageListProvider
Inheritance:
object MarshalByRefObject MarshalByRefDisposableObject LogicalTreeNodeBase UIElement BarCommandLink object
Implements:
IInputElement IUIElement ILogicalTreeNode IDpiAwareElement IDisposable IImageListProvider

Constructors

Initializes an instance of the class.

public BarButtonLink(BarButtonCommand command)
Parameter Type Description
command BarButtonCommand

The BarCommand upon which the link is based.

Initializes an instance of the class, for use in a programmatically created popup menu.

public BarButtonLink(string category, string name, string? text = null, int imageIndex = -1, bool? enabled = null, bool? checkable = null, bool? isChecked = null, bool? beginAGroup = null)
Parameter Type Description
category string

The category of the bar command.

name string

The name of the bar command.

text string

The text caption.

imageIndex int

The index of an image within an ImageList.

enabled bool?

Whether the button is enabled. When null, the default value is assigned (which is true unless overridden by a derived class).

checkable bool?

Whether the button is checkable. When null, the default value is assigned (which is false unless overridden by a derived class).

isChecked bool?

Whether the button is currently checked. When null, the default value is assigned (which is false unless overridden by a derived class).

beginAGroup bool?

Whether to begin a group. When null, the default value is assigned (which is false unless overridden by a derived class).

Properties

The BarButtonCommand to link to.

[Browsable(false)]
public BarButtonCommand Command { get; }

Property Value

BarButtonCommand

Methods

The UIElementDrawState for the element.

public override UIElementDrawState GetDrawState()

Returns

UIElementDrawState

Remarks

The default implementation of this method returns None.

Raises the MouseDown event.

protected override void OnMouseDown(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

The event data.

Raises the MouseUp event.

protected override void OnMouseUp(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

The event data.

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

The event data.

Inherited Members

Extension Methods