PanningFinished fires continously

2 posts, 0 answers
  1. Rieni De Rijke
    Rieni De Rijke avatar
    170 posts
    Member since:
    Mar 2010

    Posted 13 Oct 2011 Link to this post

    Is it possible that the RadMap.PanningFinished not only fires when the panning is finished?
    In our application PanningFinished fires continously when you are panning (with the mouse)?

    We have "SpringAnimation" set to "false"
    The version we are using is: 2011.2.Sp1.Internal  2011.2.1010.40  Runtime Version: v4.0.30319


  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 18 Oct 2011 Link to this post

    Hello Rieni De Rijke,

    The event works as designed. It is based on the MotionFinished event of standard Silverlight MultiScaleImage control. Our own implementation of the MultiScaleImage for WPF raises the same event. So, they have a similar behavior.
    If you want to handle event taking into account a case when the user drags map by mouse then you should handle the mouse button down / up events. The sample code is below.
    private bool mouseDownOccurs;
    private bool panningFinishedOccurs;
     
    private void RadMap1_PanningFinished(object sender, RoutedEventArgs e)
    {
        if (this.mouseDownOccurs)
        {
            // mouse down occurs
            // set flag for mouse button up event
            panningFinishedOccurs = true;
        }
        else
        {
            // PanningFinished occurs
            this.PanningFinishedLogic();
            this.panningFinishedOccurs = false;
        }
    }
     
    private void RadMap1_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
    {
        RadMap radMap = sender as RadMap;
        if (radMap != null)
        {
            this.mouseDownOccurs = true;
            radMap.CaptureMouse();
        }
    }
     
    private void RadMap1_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
    {
        RadMap radMap = sender as RadMap;
        if (radMap != null)
        {
            this.mouseDownOccurs = false;
            radMap.ReleaseMouseCapture();
     
            if (this.panningFinishedOccurs)
            {
                // PanningFinished occurs
                this.PanningFinishedLogic();
                this.panningFinishedOccurs = false;
            }
        }
    }
     
    private void PanningFinishedLogic()
    {
        // ...
    }

    Greetings,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top