Search code examples
c#wpfgraph-sharp

how to set mouse click event only on specific vertex in graphsharp?


I'm using graphsharp and to display different pictures in different kinds of vertex, however I couldn't find a way to set only on specific type of vertex that display specific pictures mouse click event. I need only specific vertex to handle the event. can anyone help me?


Solution

  • Try use directly without trigger... I use this on vertex context menu

    <Style TargetType="{x:Type GraphSharp_Controls:VertexControl}">
    <Setter Property="ContextMenu">
        <Setter.Value>
            <ContextMenu>
                <ContextMenu.ItemContainerStyle>
                    <Style TargetType="MenuItem">
                        <EventSetter Event="Click" Handler="ContextMenuClick"/>
                        ...