Table of Contents
Expand and Collapse Effect

EO.Wpf Menu supports custom expand/collapse effect. To set a custom expand/collpase effect, set the menu's ExpandEffect/ CollapseEffect property. The following sample demonstrates how to use these feature:

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.ExpandEffect>
                <eo:Effect Type="GlideTopLeftToBottomRight"  Duration="300"></eo:Effect>
            </eo:Menu.ExpandEffect>
            <eo:Menu.CollapseEffect>
                <eo:Effect Type="GlideTopLeftToBottomRight" Duration="300"></eo:Effect>
            </eo:Menu.CollapseEffect>
            <eo:MenuItem Header="_File">
                <eo:MenuItem Header="_New"></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 sets both ExpandEffect and CollapseEffect to GlideTopLeftToBottomRight. When user clicks the "File" menu item, the sub menu expands from top left to bottom right instead of expanding from top to the bottom. When the sub menu closes, it collapses from bottom right to top left. Note the effect type for the CollapseEffect is still set to GlideTopLeftToBottomRight, not GlideBottomRightToTopLeft. This is because CollapseEffect always reverses the effect. That allows you to set both ExpandEffect and CollapseEffect to the same value, while they plays opposite effects.