Back to Devexpress

AddBarItemLinkAction Class

wpf-devexpress-dot-xpf-dot-bars-0454d0e4.md

latest3.6 KB
Original Source

AddBarItemLinkAction Class

Adds a bar item link to the link container (a bar, a menu, etc.).

Namespace : DevExpress.Xpf.Bars

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

NuGet Package : DevExpress.Wpf.Core

Declaration

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

Remarks

A link container to which a bar item link is added can be identified via these properties:

The following code adds a link to the btnAbout item to the main menu:

xaml
<dxb:BarButtonItem x:Name="btnAbout" Content="About" ItemClick="btnAbout_ItemClick"/>
<!--...-->
<dxb:AddBarItemLinkAction TargetType="MainMenu">
    <dxb:AddBarItemLinkAction.ItemLink>
        <dxb:BarButtonItemLink x:Name="myBarItemLink" BarItemName="btnAbout"/>
    </dxb:AddBarItemLinkAction.ItemLink>
</dxb:AddBarItemLinkAction>

The BarItemLinkActionBase.Target and BarItemLinkActionBase.TargetType properties are attached properties. They can be used as shown in the following example. In the code below, a BarButtonItemLink object, referring to a btnExit item, is created and added to the ‘menuFile’ menu:

xaml
<dxb:BarButtonItemLink x:Name="btnExitLink" BarItemName="btnExit" dxb:BarItemLinkActionBase.Target="menuFile"/>

See Bar Actions to learn more.

Implements

IControllerAction

Inheritance

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement BarManagerControllerActionBase BarItemLinkActionBase InsertBarItemLinkAction AddBarItemLinkAction

See Also

AddBarItemLinkAction Members

Bar Actions

DevExpress.Xpf.Bars Namespace