Skip to main content
A newer version of this page is available. .
Bar

BarItemLinkSeparator Class

Represents a separator between item links.

Namespace: DevExpress.Xpf.Bars

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

NuGet Package: DevExpress.Wpf.Core

Declaration

public class BarItemLinkSeparator :
    BarItemLink

Remarks

To create a separator between bar item links, you need to create a BarItemLinkSeparator object and add it to the ItemLinks collection of a container (a bar, popup menu, sub-menu, etc).

Note: Unlike regular bar item links, the BarItemLinkSeparator class does not have a matching bar item class.

Example

This example shows how to create bar button items (BarButtonItem objects) and add a link separator between them. The separator is created using the DevExpress.Wpf.Bars.BarItemLinkSeparator class.

The following image shows the result:

E1575

View Example

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" 
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
        x:Class="BarItemLinkSeparatorEx.Window1" 
        Title="Window1" Height="300" Width="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <dxb:BarContainerControl Grid.Row="0">
            <dxb:ToolBarControl Caption="Main Toolbar"  BarItemHorizontalIndent="10">
                <dxb:BarButtonItem Content="Undo" Glyph="{dx:DXImage Image=undo16x16.png}" ItemClick="itemClick"/>
                <dxb:BarButtonItem Content="Redo" Glyph="{dx:DXImage Image=redo16x16.png}" ItemClick="itemClick"/>
                <dxb:BarItemLinkSeparator />
                <dxb:BarButtonItem Content="Copy" Glyph="{dx:DXImage Image=copy16x16.png}" ItemClick="itemClick"/>
                <dxb:BarButtonItem Content="Paste" Glyph="{dx:DXImage Image=paste16x16.png}" ItemClick="itemClick"/>

            </dxb:ToolBarControl>
        </dxb:BarContainerControl>

        <RichTextBox Grid.Row="1"/>


    </Grid>
</Window>
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes

Namespace BarItemLinkSeparatorEx
    ''' <summary>
    ''' Interaction logic for Window1.xaml
    ''' </summary>
    Partial Public Class Window1
        Inherits Window

        Public Sub New()
            InitializeComponent()
        End Sub

        ' Respond to clicking the bar items
        Private Sub itemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
            MessageBox.Show("Item " & e.Item.Content & " has been clicked.")
        End Sub

    End Class
End Namespace

The following code snippets (auto-collected from DevExpress Examples) contain references to the BarItemLinkSeparator 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