How do I (can I?) set the ContextMenu of a AdvancedTabControlItem?
Following on from my other post I have been looking into being able to right click to bring up a ContextMenu.
Now I can see my ContextMenu is there in Snoop but Right Clicking does not give the expected result?
I can assign it to the AdvancedTabControl but it then shows the ContextMenu where ever I right click except the tab items!
I am guessing I've missed something obvious here, but looking through the example app I couldn't find anything that would help. The "Custom Context Menu" looked helpfull but using the "MenuOpening" I got a null object...
<UserControl>
<UserControl.Resources>
<ContextMenu x:Key="MyContextMenu">
<MenuItem Command="{Binding RemoveCommand}"
CommandParameter="{Binding}"
Header="Remove" />
</ContextMenu>
<Style TargetType="{x:Type docking:AdvancedTabItem}" x:Key="MyTabStyle">
<Setter Property="Background" Value="Orange"/>
<Setter Property="ContextMenu" Value="{StaticResource MyContextMenu}"/>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate >
<TextBlock Text="{Binding Name}" FontSize="22" Background="HotPink" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<docking:AdvancedTabControl CanTabsDrag="True"
ItemContainerStyle="{StaticResource MyTabStyle}"
ItemsSource="{Binding Groups}"
SelectedItem="{Binding SelectedGroup}" />
</Grid>
</UserControl>
[Modified 8 years ago]