Hello! I have Menu in my app. I'm visualizing it using hierarchical data template:
<MenuItem Header="Main menu" ItemsSource="{Binding ApplicationMenu}" >
<MenuItem.ItemTemplate>
<HierarchicalDataTemplate DataType="{x:Type tm:RMenuItem}"
ItemsSource="{Binding Path=ChildrenItems}">
<MenuItem Header="{Binding Name}" Command="{Binding RunOperationCommand}" />
</HierarchicalDataTemplate>
</MenuItem.ItemTemplate>
</MenuItem>
menu looks like as it should, but Command for each menu item is not fired! Even more - it is not bounded, which could be seen in debugger: get accessor of ICommand Property has been never executed. Why it happens so?
Doing as usual works perfect:
<Menu>
<MenuItem Header="SomeHeader" Command="{Binding RunOperationCommand}"/>
<Menu>