How can i get the vertex object info when i click on the vertex?

Nov 19, 2012 at 8:29 PM

The problem is that the Graph representation is hidden because the Graph is built via

<zoom:ZoomControl  Grid.Row="1"  Zoom="0.2"         ZoomBoxOpacity="0.5" Background="#ff656565">       

<local:VisGraphLayout x:Name="graphLayout" Margin="10"        Graph="{Binding Path=Graph}"        LayoutAlgorithmType="{Binding Path=LayoutAlgorithmType, Mode=OneWay}"        OverlapRemovalAlgorithmType="FSA"        HighlightAlgorithmType="Simple" />


Is there a way to reach the Vertex object while accesing the onClick method?

Nov 23, 2012 at 2:19 AM

Hi galexia1000,

If I understand correctly you are trying to intercept the click event of a vertex in order to do something with it.

This XAML code modifies the control to allow you to hook into mouse events. This works basically for any event type:

<Style TargetType="{x:Type graphsharp:VertexControl}">
            <Setter Property="Template">
                    <ControlTemplate TargetType="{x:Type graphsharp:VertexControl}">
                        <Border BorderBrush="White" 
                            Padding="{TemplateBinding Padding}"
                            <ContentPresenter Content="{TemplateBinding Vertex}" 
                                ContentTemplate="{StaticResource vertexTemplate}" />
			 <!-- The vertextTemplate refers to the DataTemplate containing your vertex data -->
                                <DropShadowEffect BlurRadius="2" Color="LightGray" 
                                    Opacity="0.3" Direction="315" />