예제 #1
0
        private void Rotary_Tapped(object sender, TappedRoutedEventArgs e)
        {
            FrameworkElement element = sender as FrameworkElement;

            Point point  = e.GetPosition(element);
            Point center = element.Center();

            // ***
            // *** The rotation angle is the opposite of the angle as
            // *** calculated in the euclidean space.
            // ***
            double rotation = center.GetAngle(point).ToDegrees().ToRotation();

            this.Rotation = rotation;
        }
예제 #2
0
        private void Rotary_ManipulationStarting(object sender, ManipulationStartingRoutedEventArgs e)
        {
            FrameworkElement element = sender as FrameworkElement;

            e.Pivot = new ManipulationPivot(element.Center(), element.ActualWidth / 2.0);
        }