Node position after using the Slider

Hello,

I have a StateChart diagram, and after I’ve used to silverlight Slider in order to zoom in and out the chart, I’m not able to click on the node. I need to search for the clickable point of the node in the canvas as it is not in the node itself. In other words, when I change the size using the slider, the location of the node won’t be updated and if i want to click on the node i need to search for the initial location and click on it.

Is there any solution for this?

thanks

I’m sorry, but I don’t understand what you want to do.

Are you asking how to zoom the diagram about a particular point, which might be the point in model coordinates where a particular Node is? If so, you can temporarily set the DiagramPanel.ZoomPoint property to be the center of your chosen Node.

What I mean is that I’m not able to make transitions after I’ve changed the display of the graph by using the Slider control.



How can I use the DiagramPanel.ZoomPoint?



here is a snippet of my code, but it still doesn’t work:



private void Slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)

{

CanvasScaleTransform.ScaleX = Slider1.Value;

CanvasScaleTransform.ScaleY = Slider1.Value;

System.Windows.Point p = myDiagram.Panel.ZoomPoint;

p.X = Slider1.Value;

p.Y = Slider1.Value;

}



Any help please?

I don’t know what CanvasScaleTransform is in your application, but it almost certainly isn’t what you want to do.

I would just set the Diagram.Panel.Scale property.

Thanks walter, this property Diagram.Panel.Scale has solved my problem