我在WPF应用程序中创建了RadMenu
,并为RadMenuItems
添加了一个上下文菜单。以下是RadMenu
的代码/ XAML
<telerik:RadMenu Name="radMenu1" ItemsSource="{Binding MenuHeaders}" Height="76">
<telerik:RadMenu.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Children}">
<HierarchicalDataTemplate.ItemContainerStyle>
<Style TargetType="telerik:RadMenuItem">
<Setter Property="Command"
Value="{Binding Command}" />
</Style>
</HierarchicalDataTemplate.ItemContainerStyle>
<StackPanel Height="Auto">
<Image MaxWidth="32" MaxHeight="32" Source="{Binding mImage}" />
<TextBlock HorizontalAlignment="Center" Text="{Binding mText}"></TextBlock>
<Image MaxWidth="10" MaxHeight="10" HorizontalAlignment="Center" Source="{Binding mDownImage}" />
</StackPanel>
</HierarchicalDataTemplate>
</telerik:RadMenu.ItemTemplate>
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu>
<telerik:RadMenuItem Header="Add to Wishlist">
<telerik:RadMenuItem.Icon>
<Image Source="/WPFTestApp;component/Images/New.png" />
</telerik:RadMenuItem.Icon>
</telerik:RadMenuItem>
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</telerik:RadMenu>
ContextMenu工作正常但是当我右键单击任何RadMenuItem
时,ContextMenu被打开但RadMenu被关闭。我想保持RadMenu开放,但不知道怎么做?