예제 #1
0
 private void OnManipulationHostPointerMoved(DrawingSurfaceManipulationHost sender, Windows.UI.Core.PointerEventArgs args)
 {
     if (m_surfacePainter == null)
     {
         return;
     }
 }
 private void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
 {
     if (this.PointerReleased != null)
     {
         this.PointerReleased(sender, args);
     }
 }
 /// <summary>
 /// Sets the manipulation host.
 /// </summary>
 /// <param name="manipulationHost">Manipulation host object.</param>
 public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
 {
     if (this.ManipulationHostChanged != null)
     {
         this.ManipulationHostChanged(this, manipulationHost);
     }
 }
예제 #4
0
            private static void OnPointerReleased(DrawingSurfaceManipulationHost sender, PointerEventArgs args)
            {
                var pointerPoint = args.CurrentPoint;

                // To convert from DIPs (device independent pixels) to screen resolution pixels.
                var dipFactor = DisplayProperties.LogicalDpi / 96.0f;
                var pos       = new Vector2((float)pointerPoint.Position.X, (float)pointerPoint.Position.Y) * dipFactor;

                TouchPanel.AddEvent((int)pointerPoint.PointerId, TouchLocationState.Released, pos);
            }
예제 #5
0
        /// <summary>
        /// Binds to the following events:
        ///  <see cref="DrawingSurfaceManipulationHost.PointerMoved"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerPressed"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerReleased"/>
        /// </summary>
        /// <param name="manipulationHost">An instance of <see cref="DrawingSurfaceManipulationHost"/>.</param>
        /// <exception cref="ArgumentNullException">Is thrown if <paramref name="manipulationHost"/> is null.</exception>
        void IDrawingSurfaceManipulationHandler.SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (manipulationHost == null)
            {
                throw new ArgumentNullException("manipulationHost");
            }

            manipulationHost.PointerMoved    += (_, e) => CreateAndAddPoint(PointerEventType.Moved, e.CurrentPoint);
            manipulationHost.PointerPressed  += (_, e) => CreateAndAddPoint(PointerEventType.Pressed, e.CurrentPoint);
            manipulationHost.PointerReleased += (_, e) => CreateAndAddPoint(PointerEventType.Released, e.CurrentPoint);
        }
예제 #6
0
        /// <summary>
        /// Wird aufgerufen, wenn der Bearbeitungshandler für ein DrawingSurface- oder DrawingSurfaceBackgroundGrid-Steuerelement festgelegt wird.
        /// </summary>
        /// <param name="manipulationHost">Das Objekt, das die Bearbeitungsereignisse von der Zeichenoberfläche empfängt.</param>
        public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (m_surfacePainter == null)
            {
                return;
            }

            if (m_manipulationHost != null)
            {
                m_manipulationHost.PointerMoved    -= OnManipulationHostPointerMoved;
                m_manipulationHost.PointerPressed  -= OnManipulationHostPointerPressed;
                m_manipulationHost.PointerReleased -= OnManipulationHostPointerReleased;
            }
            m_manipulationHost = manipulationHost;
            if (m_manipulationHost != null)
            {
                m_manipulationHost.PointerMoved    += OnManipulationHostPointerMoved;
                m_manipulationHost.PointerPressed  += OnManipulationHostPointerPressed;
                m_manipulationHost.PointerReleased += OnManipulationHostPointerReleased;
            }
        }
예제 #7
0
        /// <summary>
        /// Binds to the following events:
        ///  <see cref="DrawingSurfaceManipulationHost.PointerMoved"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerPressed"/>,
        ///  <see cref="DrawingSurfaceManipulationHost.PointerReleased"/>
        /// </summary>
        /// <param name="manipulationHost">An instance of <see cref="DrawingSurfaceManipulationHost"/>.</param>
        /// <exception cref="ArgumentNullException">Is thrown if <paramref name="manipulationHost"/> is null.</exception>
        void IDrawingSurfaceManipulationHandler.SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
        {
            if (manipulationHost == null) throw new ArgumentNullException("manipulationHost");

            manipulationHost.PointerMoved += (_, e) => CreateAndAddPoint(PointerEventType.Moved, e.CurrentPoint);
            manipulationHost.PointerPressed += (_, e) => CreateAndAddPoint(PointerEventType.Pressed, e.CurrentPoint);
            manipulationHost.PointerReleased += (_, e) => CreateAndAddPoint(PointerEventType.Released, e.CurrentPoint);
        }
예제 #8
0
 public void SetManipulationHost(DrawingSurfaceManipulationHost manipulationHost)
 {
     manipulationHost.PointerPressed  += OnPointerPressed;
     manipulationHost.PointerMoved    += OnPointerMoved;
     manipulationHost.PointerReleased += OnPointerReleased;
 }
 private void OnManipulationHostChanged(object sender, DrawingSurfaceManipulationHost host)
 {
     host.PointerPressed += this.OnPointerPressed;
     host.PointerMoved += this.OnPointerMoved;
     host.PointerReleased += this.OnPointerReleased;
 }