Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

InsertBarItemAction Class

Inserts a bar item at a specific position within the BarManager.Items collection.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

[Browsable(false)]
public class InsertBarItemAction :
    BarManagerControllerActionBase

#Remarks

This action inserts InsertBarItemAction.Item at a specific position (InsertBarItemAction.ItemIndex) within the BarManager.Items collection.

The InsertBarItemAction object can be used as follows:

<dxb:InsertBarItemAction ItemIndex="0">
    <dxb:InsertBarItemAction.Item>
        <dxb:BarButtonItem x:Name="myButton" Content="My Button" ItemClick="myButton_ItemClick"/>
    </dxb:InsertBarItemAction.Item>
</dxb:InsertBarItemAction>

The InsertBarItemAction.ItemIndex property is an attached property. It can be set for a BarItem object when the bar item acts as an action:

<!--Create a bar item adding it at the first position in the BarManager.Items collection and display the item in the barStatusBar-->
<dxb:BarManagerActionContainer>
    <dxb:BarButtonItem x:Name="myButton2" Content="My Button 2" 
                       dxb:InsertBarItemAction.ItemIndex="0" 
                       dxb:InsertBarItemLinkAction.Target="barStatusBar" 
                       ItemClick="myButton2_ItemClick"/>
    <!--...-->
</dxb:BarManagerActionContainer>

See Bar Actions to learn more.

#Implements

See Also