Click here to Skip to main content
15,314,455 members

Comments by Graham Coulby (Top 2 by date)

Graham Coulby 30-Jul-15 3:23am View
   
OK, you are a legend!

The problem was to do with the new TranslateTransform in a sense. By storing the TranslateTransform as a property I can modify the XStart and YStart

I changed Ruler_MouseDown to this

private void Ruler_MouseDown(object sender, MouseButtonEventArgs e)
{

XStart = e.GetPosition(Grid).X - Translate.X;
YStart = e.GetPosition(Grid).Y - Translate.Y;

IsMouseDown = true;
}

And now it works. Thank you very much!!!!!
Graham Coulby 30-Jul-15 3:16am View
   
OK so I set the property in the class to
TranslateTransform Translate = new TranslateTransform();

and changed ruler_mousedown to this

private void Ruler_MouseMove(object sender, MouseEventArgs e)
{

if(IsMouseDown)
{
X = e.GetPosition(Grid).X - XStart;
Y = e.GetPosition(Grid).Y - YStart;

Translate.X = X;
Translate.Y = Y;

Ruler.RenderTransform = Translate;
}
}


However, the problem persists, is it possible that it is because of the e.GetPosition(Grid)