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; } }
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(); }
// Start is called before the first frame update void Start() { chessBoardManager = GameObject.Find("BoardPlane").GetComponent <ChessBoardManager>(); manipulationManager = GameObject.Find("BoardPlane").GetComponent <ManipulationManager>(); }