Hello,
is it possible to define an ItemsSource for a RadContextMenu only for a particular Part of the ContextMenu?
My Target is to have Header and Footer Items, which are always shown up (fixed Items) and to have Contextual Items which are filled from Item behind.
I tried it with an ItemsControl. This works so far, but if I hover one Contextual Item, the full ItemsControl is highlighted. Also the Icon is indented. Please see the attached Screenshot.
How can I remove the wrong highlighting and the Icon Indentation?
Thank you for your help!
My existing Source Code is the following (see ItemsControl):
is it possible to define an ItemsSource for a RadContextMenu only for a particular Part of the ContextMenu?
My Target is to have Header and Footer Items, which are always shown up (fixed Items) and to have Contextual Items which are filled from Item behind.
I tried it with an ItemsControl. This works so far, but if I hover one Contextual Item, the full ItemsControl is highlighted. Also the Icon is indented. Please see the attached Screenshot.
How can I remove the wrong highlighting and the Icon Indentation?
Thank you for your help!
My existing Source Code is the following (see ItemsControl):
RadContextMenu.Resources> <DataTemplate x:Key="SubItemTemplate"> <telerik:RadMenuItem Header="{Binding DisplayName}" IsEnabled="{Binding Enabled}"> <telerik:RadMenuItem.Icon> <Image Stretch="Fill" MinHeight="0" MinWidth="0" MaxWidth="16" MaxHeight="16" Width="Auto" Height="Auto" Source="{Binding Image}" /> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> </DataTemplate> </telerik:RadContextMenu.Resources> <!-- Region Add --> <telerik:RadMenuItem Header="Add" ItemsSource="{Binding Path=PossibleSubItems}" FontWeight="Bold" ItemTemplate="{StaticResource SubItemTemplate}"> <telerik:RadMenuItem.Icon> <Image Width="16" Height="16" Stretch="Fill" Source="/Images/add2_16.png" /> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <telerik:RadMenuItem IsSeparator="True" /> <!-- End Region --> <!-- FOLLOWING PART SHOWS THE CONTEXTUAL SUB-ITEMS --> <ItemsControl ItemsSource="{Binding ContextMenuSubItems}" ItemTemplate="{StaticResource SubItemTemplate}" /> <telerik:RadMenuItem IsSeparator="True" /> <!-- Region Delete --> <telerik:RadMenuItem Header="Delete..."> <telerik:RadMenuItem.Icon> <Image Source="/Images/delete2_16.png" /> </telerik:RadMenuItem.Icon> </telerik:RadMenuItem> <!-- End Region --> <!-- Region Rename --> <telerik:RadMenuItem Header="Rename" /> <!-- End Region --></telerik:RadContextMenu>