private void ChangeDialPosition(object sender, MouseEventArgs e) { if (dialWasClicked) { if (e.LeftButton == MouseButtonState.Pressed) { this.Angle = Dial.GetAngle(e.GetPosition(DialElement), DialElement.RenderSize); RotateElement.Angle = this.Angle; if (RotateDialForward() || DialOnZeroFwd()) { DialValue.Text = (++currentFrame).ToString(); previousAngle = (int)(Angle / 360 * 10) % 10; VideoDisplay.NextFrame(); } else if ((RotateDialBackwards() || DialOnZeroBack()) && (currentFrame - 1) >= 0) { DialValue.Text = (--currentFrame).ToString(); previousAngle = (int)(Angle / 360 * 10) % 10; VideoDisplay.PrevFrame(); } } } }