Logo
My Account |  Site Map | Contact Us  
 The same content in Microsoft HTML help file format is included in the download package.
Sub Menu Indicator

By default, EO.Wpf.Menu displays a small black triangle to indicate a menu item has child items. You can customize this through SubMenuIndicatorTemplate property. The following sample replaces the standard black triangle with ">>":

XAML
<Window x:Class="Test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:eo="http://schemas.essentialobjects.com/wpf/"
        Title="MainWindow" Height="250" Width="350">
    <StackPanel>
        <eo:Menu IsMainMenu="True">
            <eo:Menu.SubMenuIndicatorTemplate>
                <DataTemplate>
                    <Path Stroke="Black" StrokeThickness="1" Data="M 0,0 L 4,4 L 0,8 M 3,0 L 7,4 L 3,8"></Path>
                </DataTemplate>
            </eo:Menu.SubMenuIndicatorTemplate>
            <eo:MenuItem Header="_File">
                <eo:MenuItem Header="Open">
                    <eo:MenuItem Header="Item 1"></eo:MenuItem>
                    <eo:MenuItem Header="Item 2"></eo:MenuItem>
                    <eo:MenuItem Header="Item 3"></eo:MenuItem>
                </eo:MenuItem>
                <eo:MenuItem IsSeparator="True"></eo:MenuItem>
                <eo:MenuItem Header="Exit"></eo:MenuItem>
            </eo:MenuItem>
            <eo:MenuItem Header="_Edit" />
            <eo:MenuItem Header="_View" />
            <eo:MenuItem Header="_Window" />
            <eo:MenuItem Header="_Help" />
        </eo:Menu>
    </StackPanel>
</Window>

The above code produces the following result:


Direct link to this topic