public void Start() { if (ended) { ended = false; nonFinalCanvas.Visibility = Visibility.Visible; finalCanvas.Visibility = Visibility.Collapsed; EasingFunctionBase easing = new CubicEase(); effect = new RotateEffect(-90, 90, 6, EasingMode.EaseOut, easing); effect.Completed += effect_Completed; q = new Queue<FrameworkElement>(); if (Toss) { effect.Start(finalCanvas); q.Enqueue(nonFinalCanvas); q.Enqueue(finalCanvas); } else { effect.Start(nonFinalCanvas); q.Enqueue(finalCanvas); q.Enqueue(nonFinalCanvas); } } }
public void Start() { if (ended) { NumberOfRotation=0; this.Visibility = Visibility.Visible; ended = false; nonFinalCanvas.Visibility = Visibility.Visible; finalCanvas.Visibility = Visibility.Collapsed; EasingFunctionBase easing = new SineEase(); effect = new RotateEffect(-90, 90, 100, EasingMode.EaseInOut, easing); effect.RotationCenter = new Point(0.5, 0.5); effect.Duration = 500; effect.Completed += effect_Completed; q = new Queue<FrameworkElement>(); if (Toss) { effect.Start(nonFinalCanvas); q.Enqueue(finalCanvas); q.Enqueue(nonFinalCanvas); } else { effect.Start(finalCanvas); q.Enqueue(nonFinalCanvas); q.Enqueue(finalCanvas); } } }
private void loadElt(Point p) { pointsAreadyDone.Add(p); SecreteAnimationControl elt = new SecreteAnimationControl(); elt.Width = secretElementWidth; elt.Height = secretElementHeight; //RootCanvas RootCanvas.Children.Add(elt); RootCanvas.Visibility = Visibility.Visible; int YIndice = (int)p.Y; int XIndice = (int)p.X; double left = XIndice * (secretElementWidth); double top = YIndice * (secretElementHeight); Canvas.SetLeft(elt, left); Canvas.SetTop(elt, top); elt.ForegroundColor = ColorManager.Instance.RandomAccentBrush; // OpacityEffect oe = new OpacityEffect(0, 1, 1, StartAnimationDuration, EasingMode.EaseIn, new CircleEase()); MoveEffect me = new MoveEffect(new Point(0, -top), new Point(0, 0), 10, StartAnimationDuration, EasingMode.EaseIn, new CircleEase()); RotateEffect re = new RotateEffect(-90, 0, 1, StartAnimationDuration, EasingMode.EaseOut, new CircleEase()); re.RotationCenter = new Point(0, 0); elt.addStartEffect(me); elt.addStartEffect(re); // elt.addStartEffect(oe); MoveEffect meStop = new MoveEffect(new Point(0, 0), new Point(0, 1.1 * Height), 1, StopAnimationDuration, EasingMode.EaseIn, new CircleEase()); RotateEffect reStop = new RotateEffect(0, -90, 1, StopAnimationDuration, EasingMode.EaseOut, new CircleEase()); reStop.RotationCenter = new Point(0, 0); elt.addStopEffect(meStop); elt.addStopEffect(reStop); elt.load(); listOfElements.Add(elt); animStartOfElements.Enqueue(elt); animStopOfElements.Enqueue(elt); }