private static void OrientationPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TransformationGizmo gizmo = (TransformationGizmo)d; gizmo.RotationIndicatorTransform.Angle = gizmo.Orientation; gizmo.RotationBallTransform.Angle = gizmo.Orientation; gizmo.RotationText.Text = string.Format("{0}°", Math.Round(gizmo.Orientation, 2)); }
private static void YDraggingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TransformationGizmo gizmo = (TransformationGizmo)d; if (!(bool)e.NewValue) { gizmo.IsHitTestVisible = true; } }
private static void RotationEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { TransformationGizmo gizmo = (TransformationGizmo)d; bool rotationEnabled = (bool)e.NewValue; gizmo.RotationBall.Visibility = rotationEnabled ? Visibility.Visible : Visibility.Hidden; gizmo.RotationLine.Visibility = rotationEnabled ? Visibility.Visible : Visibility.Hidden; gizmo.RotationRing.Visibility = rotationEnabled ? Visibility.Visible : Visibility.Hidden; gizmo.RotationText.Visibility = rotationEnabled ? Visibility.Visible : Visibility.Hidden; }