public DataGridScrollExtensions.ScrollInfo GetScrollInfo() { LoadScrollBars(); DataGridScrollExtensions.ScrollInfo oInfo = new DataGridScrollExtensions.ScrollInfo(); //ScrollBar sbHorizontal = grid.GetScrollbar(ScrollMode.Horizontal); //oInfo.HorizontalMaximum = sbHorizontal.Maximum; //oInfo.HorizontalPosition = sbHorizontal.Value; ScrollBar sbVertical = MyVerticalScrollBar; oInfo.VerticalMaximum = MyScrollViewer.ExtentHeight; oInfo.VerticalPosition = MyScrollViewer.VerticalOffset; return(oInfo); }
public void SetScrollPosition( DataGridScrollExtensions.ScrollInfo info) { LoadScrollBars(); //if (info.HorizontalPosition > 0) //{ // ScrollBar sbHorizontal = grid.GetScrollbar(ScrollMode.Horizontal); // sbHorizontal.Maximum = info.HorizontalMaximum; // grid.Scroll(ScrollMode.Horizontal, info.HorizontalPosition); //} if (info.VerticalPosition > 0) { //ScrollBar sbVertical = MyVerticalScrollBar; //sbVertical.Maximum = ; //this.Scroll(ScrollMode.Vertical, ); MyScrollViewer.ScrollToVerticalOffset(info.VerticalPosition); } }