Back to Devexpress

BarItemLink Class

wpf-devexpress-dot-xpf-dot-bars-2210ed63.md

latest6.0 KB
Original Source

BarItemLink Class

Represents the base class for bar item links.

Namespace : DevExpress.Xpf.Bars

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public class BarItemLink :
    BarItemLinkBase
vb
Public Class BarItemLink
    Inherits BarItemLinkBase

The following members return BarItemLink objects:

Remarks

All elements displayed by Bars, Ribbon and Menus are represented by bar items and bar item links.

A bar item link is a BarItemLink descendant instance that refers to a bar item defined in another location. For instance, you can create an “Open File” bar item that invokes the “Open File” dialog. Then you can add a link to this item within the main menu and add another link to the same item in a toolbar. Use the BarItem.BarItemName property to associate a bar item link with a specific bar item.

Bar item links can be added as elements to bars, sub-menus, popup menus and Ribbon controls.

The following example creates the Edit toolbar. Elements of this toolbar are three bar item links that refer to the items defined in the BarManager.Items collection.

xaml
<dxb:BarManager>
    <dxb:BarManager.Items>
        <dxb:BarButtonItem x:Name="biCut" Content="Cut" Glyph="{dx:DXImage Image=Cut_16x16.png}" LargeGlyph="{dx:DXImage Image=Cut_32x32.png}"/>
        <dxb:BarButtonItem x:Name="biCopy" Content="Copy" Glyph="{dx:DXImage Image=Copy_16x16.png}" LargeGlyph="{dx:DXImage Image=Copy_32x32.png}"/>
        <dxb:BarButtonItem x:Name="biPaste" Content="Paste" Glyph="{dx:DXImage Image=Paste_16x16.png}" LargeGlyph="{dx:DXImage Image=Paste_32x32.png}"/>
    </dxb:BarManager.Items>
    <dxb:BarManager.Bars>
        <dxb:Bar Caption="Edit">
            <dxb:BarButtonItemLink BarItemName="biCut"/>
            <dxb:BarButtonItemLink BarItemName="biCopy"/>
            <dxb:BarButtonItemLink BarItemName="biPaste"/>
        </dxb:Bar>

    </dxb:BarManager.Bars>
    <Grid/>
</dxb:BarManager>

Refer to the Items and Links topic for more information.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BarItemLink 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.

how-to-create-supertips-for-bar-items-ribbon-items-and-standard-controls-in-code-and-xaml-e2702/CS/SuperTipForRibbonFromCode.xaml#L26

xml
<dxr:RibbonPageGroup Caption="Document">
    <dxb:BarItemLink BarItemName="bNew" RibbonStyle="Large"/>
</dxr:RibbonPageGroup>

Implements

IControllerAction

Inheritance

Show 23 items

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement BarItemLinkBase BarItemLink BarButtonItemLink

BarEditItemLink

BarItemLinkMenuHeader

BarItemLinkSeparator

BarLinkContainerItemLink

BarStaticItemLink

BarButtonGroupLink

RibbonGalleryBarItemLink

BarItemSelectorLink

BarSplitButtonItemLink

BarSplitCheckItemLink

BarListItemLink

LinkListItemLink

ToolbarListItemLink

BarSubItemLink

BarCheckItemLink

See Also

BarItemLink Members

Items and Links

DevExpress.Xpf.Bars Namespace