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 Murat,
I have logged this behavior with our developers in our tracking system, with an issue ID of 146324. I have also created a support ticket on your behalf with number CAS-119489-S1T0B9 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Hello,
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>
I am just checking if you require any further assistance on the matter.
Thank you for your post. I have been looking into your issue and I would like to know, how exactly you are expecting to behave the XamRibbon control. It would be great, if you can attach a descriptive screenshot or a sample application.
Looking forward to hearing from you.