I have this hierarchy of menu items and are templated as follows, but I'm unable to get the second level template (Header) get to work.
public class MenuItem { public MenuItem() { Children = new List<MenuItem>(); } public string Header { get; set; } public ICommand Command { get; set; } public List<MenuItem> Children { get; set; } }
<igs:MenuTool Caption="New" ItemsSource="{Binding Menus}"> <igs:MenuTool.ItemTemplate> <HierarchicalDataTemplate DataType="local:MenuItem" ItemsSource="{Binding Children}"> <TextBlock Text="{Binding Header}"/> <HierarchicalDataTemplate.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Header}"/> </DataTemplate> </HierarchicalDataTemplate.ItemTemplate> </HierarchicalDataTemplate> </igs:MenuTool.ItemTemplate> </igs:MenuTool>
Can you help with this?
Hello,
I am just checking if you require any further assistance on the matter.
We just upgraded from 11.2 to 12.2 (latest service release (June - 2013). We had a very similar code to this where a menu tool was showing a menu items with some submenus, as well. After the upgrade, we cannot see the submenus anymore (see screenshot). Here is the code that stopped working. Right now, we switched to WPF's Menu. It is so sad to see things stop working after a library upgrade.
<igRibbon:RibbonGroup Caption="Caption Name"> <igRibbon:RibbonGroup.Resources> <HierarchicalDataTemplate DataType="{x:Type GroupViewModel}" ItemsSource="{Binding Path=SubMenuItems}"> <TextBlock Text="{Binding Path=DisplayName}" /> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type MenuItemViewModel}"> <igRibbon:ButtonTool Caption="{Binding Path=DisplayName}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type igRibbon:XamRibbonWindow}}, Path=DataContext.ShowScreen}" CommandParameter="{Binding}" /> </DataTemplate> </igRibbon:RibbonGroup.Resources> <igRibbon:MenuTool igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge" ButtonType="DropDown" Caption="Caption Name 1" ToolTip="Caption Name 1" LargeImage="/Images/dashboard.png" HorizontalAlignment="Left" ItemsSource="{Binding Path=MenuItems}"> </igRibbon:MenuTool> </igRibbon:RibbonGroup>