I declare the style
of my control in library:
<ContentControl.Resources>
<ContextMenu x:Key="ContextMenu">
<MenuItem Header="{x:Static Drawing:Headers.AddEdge}" Click="AddEdgeClick"/>
<MenuItem Header="{x:Static Drawing:Headers.ChangeID}" Click="ChangeIDClick"/>
<MenuItem Header="{x:Static Drawing:Headers.Remove}" Click="RemoveClick"/>
</ContextMenu>
<Style x:Key="Style" TargetType="{x:Type Drawing:Node}">
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu}"/>
</Style>
</ContentControl.Resources>
<ContentControl.Style>
<StaticResource ResourceKey="Style"/>
</ContentControl.Style>
But global style for this control in application doesn't work...
<Style TargetType="Drawing:Node">
<Setter Property="ContextMenu" Value="{x:Null}"/>
<EventSetter Event="MouseLeftButtonUp" Handler="DirectoryClicked"/>
</Style>