Esempio n. 1
0
        private static void ContinueTiltEffect(FrameworkElement element, ManipulationDeltaEventArgs e)
        {
            FrameworkElement frameworkElement = e.ManipulationContainer as FrameworkElement;

            if (frameworkElement == null || element == null)
            {
                return;
            }
            Point point = frameworkElement.TransformToVisual((UIElement)element).Transform(e.ManipulationOrigin);

            if (!new Rect(0.0, 0.0, TiltEffect.currentTiltElement.ActualWidth, TiltEffect.currentTiltElement.ActualHeight).Contains(point))
            {
                TiltEffect.PauseTiltEffect();
            }
            else
            {
                TiltEffect.ApplyTiltEffect(TiltEffect.currentTiltElement, point, TiltEffect.currentTiltElementCenter);
            }
        }
Esempio n. 2
0
        private static void ContinueTiltEffect(FrameworkElement element, ManipulationDeltaEventArgs e)
        {
            FrameworkElement manipulationContainer = e.ManipulationContainer as FrameworkElement;

            if (manipulationContainer == null || element == null)
            {
                return;
            }
            Point touchPoint = ((UIElement)manipulationContainer).TransformToVisual((UIElement)element).Transform(e.ManipulationOrigin);
            Rect  rect       = new Rect(0.0, 0.0, TiltEffect.currentTiltElement.ActualWidth, TiltEffect.currentTiltElement.ActualHeight);

            // ISSUE: explicit reference operation
            if (!rect.Contains(touchPoint))
            {
                TiltEffect.PauseTiltEffect();
            }
            else
            {
                TiltEffect.ApplyTiltEffect(TiltEffect.currentTiltElement, touchPoint, TiltEffect.currentTiltElementCenter);
            }
        }