示例#1
0
 public void Detach(UIElement element)
 {
     _element.MouseLeftButtonDown -= ElementMouseLeftButtonDown;
     _behavior.RootVisual.MouseMove -= RootVisualMouseMove;
     _behavior.RootVisual.MouseLeftButtonUp -= RootVisualMouseLeftButtonUp;
     _element = null;
     _behavior = null;
     _processor = null;
 }
示例#2
0
 public void Detach(UIElement element)
 {
     _element.MouseLeftButtonDown           -= ElementMouseLeftButtonDown;
     _behavior.RootVisual.MouseMove         -= RootVisualMouseMove;
     _behavior.RootVisual.MouseLeftButtonUp -= RootVisualMouseLeftButtonUp;
     _element   = null;
     _behavior  = null;
     _processor = null;
 }
示例#3
0
 public void Attach(
     UIElement element, 
     MultiTouchBehavior behavior,
     MultiTouchProcessor processor)
 {
     _element = element;
     _element.MouseLeftButtonDown += ElementMouseLeftButtonDown;
     _behavior = behavior;
     _processor = processor;
 }
示例#4
0
 public void Attach(
     UIElement element,
     MultiTouchBehavior behavior,
     MultiTouchProcessor processor)
 {
     _element = element;
     _element.MouseLeftButtonDown += ElementMouseLeftButtonDown;
     _behavior  = behavior;
     _processor = processor;
 }
示例#5
0
        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
        }
        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
        }