private void Canvas_SizeChanged(object sender, SizeChangedEventArgs e) { Center.X = e.NewSize.Width / 2; Center.Y = e.NewSize.Height / 2; Radius = Math.Min(e.NewSize.Width, e.NewSize.Height) / 2 - ThumbSize / 2; Ellipse.Width = Ellipse.Height = Radius * 2; Canvas.SetLeft(Ellipse, Center.X - Radius); Canvas.SetTop(Ellipse, Center.Y - Radius); Rotation = rotation; AngleChange?.Invoke(this, Rotation / 180 * Math.PI, Rotation); //用户控件:Value改变 }
//滚轮 private void Wheel_Changed(Point p, double d) { Rotation += d / 100; AngleChange?.Invoke(this, Rotation / 180 * Math.PI, Rotation); //用户控件:Value改变 }
private void Complete(Point p) { Rotation = Method.点角度(Center, p); AngleChange?.Invoke(this, Rotation / 180 * Math.PI, Rotation); //用户控件:Value改变 }