WPF window reports old left property after DragMove

Total Post:119


 1978  View(s)
Rate this:

I have this issue, after calling DragMove(), the window reports its old Left property as if DragMove did not change it at all.

so lets say the window's left is currently 100 pixels, i move the window using DragMove():

private void Window_MouseDown(object sender, MouseButtonEventArgs e)


    if (e.LeftButton == MouseButtonState.Pressed)





after which i click a button an show the new Left position of the window:

private void SomeButton_Click(object sender, RoutedEventArgs e)




however, the Message box still shows '100' as if the window didnt move at all although it did...

what am i missing?

  1. Re: WPF window reports old left property after DragMove

    Hi Goti, 

    try this:

    DoubleAnimation _leftAnimation = new DoubleAnimation();
    //...animation settings...
    _leftAnimation.Completed += delegate(object animSender,EventArgs animE)
        BeginAnimation(Window.LeftProperty, null);
    this.BeginAnimation(LeftProperty, _leftAnimation);

      Modified On Apr-04-2018 05:59:05 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.