private void Init() { this.Interval = 40; Duration = DefaultDuration; timer.Tick += new EventHandler(timer_Tick); eventArgs = new AnimationEventArgs(this); }
void changeItemHeightScene(object sender, AnimationEventArgs e) { int index = ((ListBoxAnimation)sender).Index; lock (itemOffsets) { int h0 = itemOffsets[index + 1] - itemOffsets[index]; int h = e.Value; int delta = h - h0; for (int i = index + 1; i < itemOffsets.Count; i++) { itemOffsets[i] += delta; } } Rectangle bounds = GetItemBounds(index); bounds.Height = this.Height - bounds.Top; Invalidate(bounds); }
void animation_Scene(object sender, AnimationEventArgs e) { int value = Width * e.Value / e.EndValue; transitionFunc(value); OnTransitionChange(e); }
protected virtual void OnTransitionChange(AnimationEventArgs e) { if (TransitionChange != null) TransitionChange(this, e); }
void navigation_TransitionCompleted(object sender, AnimationEventArgs e) { header.BeginInit(); #if SUPPORT_ALPHA animBackButton.Visible = false; header.ButtonsAlpha = 255; header.AnimButtons.Visible = false; header.BackButton.Alpha = 255; header.AnimButtons.Alpha = 0; #endif header.AnimLabel.Visible = false; header.AnimOffset = 0; header.EndInit(); header.Refresh(); inTransition = false; }
void navigation_TransitionChange(object sender, AnimationEventArgs e) { header.AnimOffset = back ? e.EndValue - e.Value : e.Value; header.AnimLabel.Visible = true; #if SUPPORT_ALPHA int alpha2 = (255 * e.Value / e.EndValue); int alpha = 255 - alpha2; header.BackButton.Alpha = alpha; header.ButtonsAlpha = alpha; header.AnimButtons.Alpha = alpha2; header.AnimBackButton.Alpha = alpha2; #endif }
void OnAnimationScene(object sender, AnimationEventArgs e) { AnchorStyles anchor = Anchor; try { Anchor = AnchorStyles.Left | AnchorStyles.Top; Top = e.Value; } finally { Anchor = anchor; } }
void AlphaAnimationScene(object sender, AnimationEventArgs e) { Alpha = e.Value; }
void BindingScene(object sender, AnimationEventArgs e) { Animation a = (Animation)sender; int index = animIndex; OffseDeltaItemTops(index, e.Value); Invalidate(); Update(); }
void scrollAnimation_Scene(object sender, AnimationEventArgs e) { ScrollBarVisible = true; SetTopOffset(e.Value); Debug.WriteLine("Scene"); }