Hi,
I have the following node template:
<DataTemplate x:Key="SimpleButtonTemplate" DataType="{x:Type classes:Element}">
<Grid go:Part.Resizable="{Binding Path=Part.Diagram.DataContext.EditMode}"
go:Part.SelectionAdorned="False"
go:Node.ZOrder="{Binding Path=Data.Z}"
go:Part.Movable="{Binding Path=Data.IsPinned, Converter={StaticResource BooleanNegationConverter}}"
go:Part.Selectable="{Binding Path=Data.IsPinned, Converter={StaticResource BooleanNegationConverter}}"
Width="{Binding Path=Data.Width, Mode=TwoWay}"
Height="{Binding Path=Data.Height, Mode=TwoWay}"
Visibility="{Binding Path=Data.Visibility}"
Background="Transparent">
<go:Node.Location>
<MultiBinding Converter="{StaticResource PosToPointConverter}" Mode="TwoWay">
<Binding Path="Data.X" Mode="TwoWay" />
<Binding Path="Data.Y" Mode="TwoWay" />
</MultiBinding>
</go:Node.Location>
<Button x:Name="button" Style="{StaticResource KeyboardButtonStyle}"
Visibility="{Binding Path=Data.NoDisplay, Converter={StaticResource BooleanToVisibilityConverterInverse}}"
IsHitTestVisible="{Binding Path=Part.Diagram.DataContext.EditMode, Converter={StaticResource BooleanNegationConverter}}"
Background="{Binding Path=Data.BackgroundBrush}" BorderBrush="{Binding Path=Data.BorderBrush}"
Foreground="{Binding Path=Data.ForegroundBrush}"
Content="{Binding Path=Data.Text}" Padding="2"
FontSize="{Binding Path=Data.FontSize, Converter={StaticResource FontSizePtConverter}, TargetNullValue=12.0}"
FontFamily="{Binding Path=Data.FontFamily, TargetNullValue=Segoe}" />
<Grid Visibility="{Binding Path=Data.NoDisplay, Converter={StaticResource BooleanToVisibilityConverter}}"
Opacity="{StaticResource StandardOpacity}">
<Path Data="M 0,0 L 0,1 1,1 1,0 0,0 1,1 M 0,1 L 1,0" Stretch="Fill" Stroke="Black" Fill="White" StrokeThickness="1" />
</Grid>
<!-- This ToggleButton makes a problem -->
<ToggleButton Width="16" Height="16"/>
</Grid>
</DataTemplate>
Now, if I zoomed in and pan so that I don’t see the complete Node but I can see the ToggleButton, when I click on the ToggleButton the Node moves so his left border is visible. In the real code there is a command bound to the togglebutton which is not fired then. I didn’t want that behavior, I want my command is fired not depending on how much of the node is in view.
What can I do?