Skip to main content
A newer version of this page is available. .
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.v18.2.dll

Declaration

[Browsable(false)]
public class InsertBarItemLinkAction :
    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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the InsertBarItemLinkAction class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Implements

See Also