Bar

InsertBarItemLinkAction Class

Inserts a bar item link to the item link collection of a target object (a bar, a menu, etc.).

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

[Browsable(false)]
public class InsertBarItemLinkAction :
    BarItemLinkActionBase
<Browsable(False)>
Public Class InsertBarItemLinkAction
    Inherits BarItemLinkActionBase

Remarks

The InsertBarItemLinkAction object inserts InsertBarItemLinkAction.ItemLink at a specific position (BarItemLinkActionBase.ItemLinkIndex) within a target object (the target object is addressed by either the BarItemLinkActionBase.Target or BarItemLinkActionBase.TargetType property).

The following code adds a link to the btnAbout item at the first position within the barFormat bar:

<dxb:InsertBarItemLinkAction Target="barFormat" ItemLinkIndex="0">
    <dxb:InsertBarItemLinkAction.ItemLink>
        <dxb:BarButtonItemLink BarItemName="btnAbout"/>
    </dxb:InsertBarItemLinkAction.ItemLink>
</dxb:InsertBarItemLinkAction>

The inherited BarItemLinkActionBase.ItemLinkIndex, BarItemLinkActionBase.Target and BarItemLinkActionBase.TargetType properties are attached properties. They can be set for BarItem and BarItemLink descendants when these act as actions (when they are added to the BarManagerActionContainer.Actions collection):

<!--Create a bar item and display a link to this item at the first position in the barFormat bar-->
<dxb:BarManagerActionContainer>
    <dxb:BarButtonItem x:Name="myButton2" Content="My Button 2" 
                       dxb:InsertBarItemLinkAction.ItemLinkIndex="0" 
                       dxb:InsertBarItemLinkAction.Target="barFormat"
                       ItemClick="myButton2_ItemClick"/>
    <!--...-->
</dxb:BarManagerActionContainer>

See Bar Actions to learn more.

Implements

See Also