Hi,
I want to perform Zoom-In on node while mouse enter. See the code below. I am facing two problem in this.
1. I want to zoom according to the zoomfactor of the diagram. Let’s say if zoomfactor is 100 than node should not be zoomed, if zoom factor is 40 than node should be zoomed 2.5 times of its original dimension.
2. I have applied double animation for the same and put AutoReverse=true.
I want some delay in autoreverse. For ex. - if time for zooming is 3ms than I want get autoreverse should happen after a time delay say 5 sec.
TransformGroup tg = new TransformGroup();
tg.Children.Add(originalTransform);
tg.Children.Add(scale);
sourceNode.RenderTransform = tg;
var xa = new DoubleAnimation(1, 2, new Duration(new TimeSpan(0, 0, 0, 0, 500)));
var ya = new DoubleAnimation(1, 2, new Duration(new TimeSpan(0, 0, 0, 0, 500)));
if (diagram.FindName("mouseEnter") != null)
diagram.UnregisterName("mouseEnter");
diagram.RegisterName("mouseEnter", scale);
Storyboard.SetTargetName(xa, "mouseEnter");
Storyboard.SetTargetProperty(xa, new PropertyPath("ScaleX"));
Storyboard.SetTargetName(ya, "mouseEnter");
Storyboard.SetTargetProperty(ya, new PropertyPath("ScaleY"));
var sb = new Storyboard();
sb.AutoReverse=True;
sb.Children.Add(xa);
sb.Children.Add(ya);
sb.Begin(diagram);
sb.Stop();
Can anybody help me on this?
Thanks,
Bala