/// <summary> /// The recommended design principle for safely executing subscribed event handlers for the <see cref="Timeline.TimelineTick"/> event /// </summary> /// <param name="args"><see cref="TimelineTickArgs"/></param> protected virtual void OnTimelineTick(TimelineTickArgs args) { // ensure there are subscribed event handlers for this event if (this.TimelineTick != null) { this.TimelineTick(this, args); } }
/// <summary> /// Handles each <see cref="Timeline.TimelineTick"/> event, which measures the rate of change and sets <see cref="Current"/> property accordingly /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected override void Timeline_Tick(object sender, TimelineTickArgs args) { args.CurrentValue = this.Current = System.Math.Round(System.Math.Abs((this.To.Value - this.From.Value) * this.EasingFunction.Ease(args.CurrentTime, this.Duration)), this.Precision).Clamp(this.From.Value, this.To.Value); }
/// <summary> /// Handles each <see cref="Timeline.TimelineTick"/> event, which measures the rate of change and sets <see cref="Current"/> property accordingly /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected abstract void Timeline_Tick(object sender, TimelineTickArgs args);