Exemplo n.º 1
0
        private void Element_Loaded(object sender, RoutedEventArgs e)
        {
            var element = sender as FrameworkElement;


            if (element != null && _canvas != null)
            {
                var manManager = new ManipulationManager(element, _canvas);

                manManager.OnFilterManipulation = ManipulationFilter.Clamp;
                manManager.Configure(true, AllowItemsRotation, true, true);

                element.Loaded -= Element_Loaded;
            }
        }
Exemplo n.º 2
0
        protected override void OnAttached()
        {
            elementToAnimate = AssociatedObject as Canvas;
            FrameworkElement e = elementToAnimate.GetVisualChild(0);

            // Create and configure manipulation manager for this image
            // leftImage can only be rotated, while rightImage can also be translated
            var manManager = new ManipulationManager(e, elementToAnimate);

            manManager.OnFilterManipulation = ManipulationFilter.Clamp; //ManipulationFilter.ClampCenterOfMass;
            manManager.Configure(true, true, true, true);

            this._manipulationManager[e] = manManager;

            elementToAnimate.SizeChanged += OnSizeChanged;
            base.OnAttached();
        }