Click on some button when node is selected

Hello,

I made some particular kind of node : On these nodes I put some button to apply some commands.

But, when the node is selected, I can’t click on my button.
The event is handle as a de-selection, instead of as a button click.

I realize to not de-select the node by setting “go:Part.Selectable=“False”” in my selection template.

I assume that the solution will come with ClickSelectingTool overriding, but it’s simpler to ask you.Wink

Thanks
Aurore

I’m sorry, but I cannot reproduce the problem you describe.

There are a number of node templates in the samples that make use of buttons, and those buttons work whether or not the node IsSelected, and whether or not the node is Selectable.

Have you established your own mouse event handlers? If so, perhaps they are interfering.

Your right, in your samples all is ok.

I modify the Entity relationship sample in the following manner :

I add my selectiontemplate :

 <DataTemplate x:Key="SelectionTemplate">
            <Grid go:Node.LocationElementName="Panel"
                  go:Part.Selectable="False">
                <Rectangle x:Name="Rectangle"
                           Fill="Transparent"
                           Stroke="Gray"
                           StrokeDashArray="2,2"
                           StrokeThickness="1.5"
                           SnapsToDevicePixels="True">
                </Rectangle>
                <Border Name="Border"
                        Padding="5">
                    <go:SpotPanel x:Name="Panel" />
                </Border>
            </Grid>
        </DataTemplate>

  <DataTemplate x:Key="NodeTemplate">
      <Border Background="Gray" BorderBrush="Gray" BorderThickness="2" CornerRadius="3" 
              go:Part.SelectionAdorned="True" go:Part.Resizable="True"
              go:Node.FromSpot="AllSides" go:Node.ToSpot="AllSides"
              go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
              go:Part.SelectionAdornmentTemplate="{StaticResource SelectionTemplate}">
  ...
 </DataTemplate>

And now, when the node is selected, clicking on “*” button doesn’t open the associated window.

Thanks for your help

Aurore

That’s because you set the <Rectangle Fill=“Transparent” …>

That causes the area inside the Rectangle to catch mouse events, so the Button in the Node doesn’t get the click event.

Just remove the Fill attribute.

Embarrassed exact…

Thank you for spending time on my not really GoDiagram questions.

Aurore