I am evaluating the WPF Ribbon control, and am trying to bind the ApplicationMenu to a collection, like this:
<igRibbon:ApplicationMenu ItemsSource="{Binding AuthorizedApplications}" ItemTemplate="{StaticResource ApplicationMenuItemTemplate}"/>
Where the ApplicationMenuItemTemplate is defined in the Window.Resources like so:
<DataTemplate x:Key="ApplicationMenuItemTemplate">
<igRibbon:ButtonTool Caption="{Binding Name}" SmallImage="{Binding SmallImagePath}" />
</DataTemplate>
No matter what I put in the DataTemplate (even If I put in a dummy ButtonTool, with a hard-coded Caption), the application Menu contains the output of the ToString() for each element in the collection. (Which is the Type of the element). It is the behavior I would expect if I didn't specify the ItemTemplate.
Any Ideas, why the ItemTemplate (or the reference to it) is not working?
Thanks
Hello,
I'm not sure why the DataTemplate is failing. If you would attach a small project which uses the part of the code which is failing, I would be happy to troubleshoot the issue.
There is also an excellent blog about using DataTamplates and ItemContainerStyles (which is another option) within WPF menus:
http://weblogs.asp.net/okloeten/archive/2007/11/14/5149692.aspx