//获取scrollViewer的偏移量
private void scrollViewer1_ScrollChanged(object sender, ScrollChangedEventArgs e)
{ offsetValue = e.HorizontalOffset; border_Left.Margin = new Thickness(offsetValue, 20, 0, 0);offsetTop = e.VerticalOffset;
border_top.Margin = new Thickness(20, offsetTop, 0, 0); }
//根据Grid大小改变设置scrollViewer的偏移量
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
{ scrollViewer1.ScrollToHorizontalOffset(grid_1.ActualWidth - LayoutRoot.ActualWidth + 200);//scrollViewer1.ScrollToVerticalOffset(grid_1.ActualHeight - LayoutRoot.ActualHeight);
}