views:

33

answers:

1

Help me please with wpf menu. I want the arrows showing that a menu item has also subitems. By default these arrows get placed beginning on the second level. but I want them to be shown on the first level also.

I don't clearly understand what to change and how. Although I found

<Trigger Property="Role" Value="SubmenuItem">

inside the item's template, but I couldn't that make to work for me.

UPD: I tried to do that:

 <Menu>
    <Menu.Resources>
       <Style TargetType="{x:Type MenuItem}">
            <Style.Triggers>
                <Trigger Property="Role" Value="TopLevelHeader">
                   <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Menu.Resources>
</Menu>

And now I have some crap like that:

alt text

You see I don't like the second element's offset. I don't know how to align that to the left. I tried to change Padding, Margin, HorizontalAlignment and HorizontalContentAligment - nothing helped.

A: 

Seems they aligned properly when icons added.

Ike