public void Detach(UIElement element) { _element.MouseLeftButtonDown -= ElementMouseLeftButtonDown; _behavior.RootVisual.MouseMove -= RootVisualMouseMove; _behavior.RootVisual.MouseLeftButtonUp -= RootVisualMouseLeftButtonUp; _element = null; _behavior = null; _processor = null; }
public void Attach( UIElement element, MultiTouchBehavior behavior, MultiTouchProcessor processor) { _element = element; _element.MouseLeftButtonDown += ElementMouseLeftButtonDown; _behavior = behavior; _processor = processor; }
private void OnAttachedImpl() { _transform = new CompositeTransform(); AssociatedObject.RenderTransform = _transform; _processor = new MultiTouchProcessor(); _processor.Delta += OnProcessorDelta; _processor.IsScaleEnabled = IsScaleEnabled; _processor.IsRotateEnabled = IsRotateEnabled; _processor.IsTranslateXEnabled = IsTranslateXEnabled; _processor.IsTranslateYEnabled = IsTranslateYEnabled; _processor.MinimumScale = MinimumScale; _processor.MaximumScale = MaximumScale; AssociatedObject.SizeChanged += ImageSizeChanged; #if DEBUG if (_isMockActive) { if (_mockTouch != null) { _mockTouch.Detach(AssociatedObject); } _mockTouch = new MockTouch(); _mockTouch.Attach( AssociatedObject, this, _processor); } else { Touch.FrameReported += TouchFrameReported; } #else Touch.FrameReported += TouchFrameReported; #endif }