<ListBox x:Name="lsbChampionsInGroup" Margin="10,220,5,11" SelectionMode="Multiple" HorizontalAlignment="Left" Width="160" RenderTransformOrigin="0.5,0.5"> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <EventSetter Event="PreviewMouseRightButtonDown" Handler="OnListBoxItemPreviewMouseRightButtonDown" /> </Style> </ListBox.ItemContainerStyle> <ListBox.ContextMenu> <ContextMenu Name="cmChampionsInGroup"> <MenuItem Header="Unselect all" Click="UnselectAllChampions" /> <Separator Background="CornflowerBlue" /> <MenuItem Header="Remove" Click="btnRemoveChampionsFromCurrentGroup_Click"/> <Separator Background="CornflowerBlue" /> <MenuItem Header="Copy" Click="CopySelectedChampionsInCurrentGroup" /> <MenuItem Header="Paste" Click="PasteSelectedChampions" /> </ContextMenu> </ListBox.ContextMenu> </ListBox> </pre>
System.Windows.Controls.ContextMenu.ContextMenuOpening
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)