Back to Devexpress

InsertBarItemAction Class

wpf-devexpress-dot-xpf-dot-bars-4a19f7e5.md

latest3.3 KB
Original Source

InsertBarItemAction Class

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

Namespace : DevExpress.Xpf.Bars

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
[Browsable(false)]
public class InsertBarItemAction :
    BarManagerControllerActionBase
vb
<Browsable(False)>
Public Class InsertBarItemAction
    Inherits 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:

xaml
<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:

xaml
<!--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

IControllerAction

Inheritance

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement BarManagerControllerActionBase InsertBarItemAction AddBarItemAction

SetBarItemAction

See Also

InsertBarItemAction Members

Bar Actions

DevExpress.Xpf.Bars Namespace