I am using a WPF ribbon control provided by Microsoft.
The problem is that when I use the DataTemplate to populate the RibbonApplicationSplitMenuItem , I get an extra level of nesting, which I think should not be.
Here is the relevant WPF code:
<Window.Resources> <DataTemplate DataType="{x:Type cfg:PluginInfoConfigurationElement}" x:Key="GotoPluginAppMenuItem"> <ribbon:RibbonApplicationMenuItem Header="{Binding Path=Key}" ImageSource="{Binding Path=Image}"/> </DataTemplate> </Window.Resources> <ribbon:RibbonApplicationMenu> <ribbon:RibbonApplicationSplitMenuItem x:Name="LoadPluginMenuItem" ItemsSource="{Binding Source={StaticResource NlpModel}, Path=AvailablePlugins}" Header="Plugins" ItemTemplate="{StaticResource GotoPluginAppMenuItem}"> </ribbon:RibbonApplicationSplitMenuItem> <ribbon:RibbonApplicationSplitMenuItem x:Name="LoadPluginMenuItem2" Header="Plugins"> <ribbon:RibbonApplicationMenuItem Header="FooPlugin" ImageSource="Images/icon-32.png"/> <ribbon:RibbonApplicationMenuItem Header="Invalid" ImageSource="Images/icon-32.png"/> </ribbon:RibbonApplicationSplitMenuItem> </ribbon:RibbonApplicationMenu>
And here is what I get:
With data template.
No template.
As you can see, when using the DataTemplate an additional level of nesting appears. How can I prevent this?
source share