Hope, now Window Panel is designed for thatfor WindowPanel.xaml.cs private void headerDragRectangle_MouseMove(object sender, MouseEventArgs e)
{
if (isTrackingMouse)
{
Rectangle rect = sender as Rectangle;
Point point = e.GetPosition(null);
double aWidth = Application.Current.Host.Content.ActualWidth / Application.Current.Host.Content.ZoomFactor;
double aHeight = Application.Current.Host.Content.ActualHeight / Application.Current.Host.Content.ZoomFactor;
if (point.X < 0) point.X = 0;
if (point.Y < 0) point.Y = 0;
if (point.X > aWidth) point.X = aWidth;
if (point.Y > aHeight) point.Y = aHeight;
double x0 = this.renderTransform.X;
double y0 = this.renderTransform.Y;
double sign = 1;
if (FlowDirection == System.Windows.FlowDirection.RightToLeft)
sign = -1;
this.renderTransform.X = x0 + (point.X - mouseOffset.X) * sign;
this.renderTransform.Y = y0 + point.Y - mouseOffset.Y;
mouseOffset = point;
}
}