Example #1
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
        }