Calculating scroll length in DataGrid
In the WPF datagrid, there's the ScrollViewer.ScrollChanged event. When I put a breakpoint at the method, I get some random float numbers. Are these pixels?
I'm basically trying to calculate开发者_开发技巧 how far I am moving along the whole horizontal scale of the DataGrid so I can update another custom plot chart in its own scale. But I'm not sure what the HorizontalChange and HorizontalOffset numbers are. Thanks.
Yes, the value returned is device independent pixels.
http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.horizontaloffset.aspx
**
A positive HorizontalOffset value corresponds to the content being offset to the left. Valid values are between zero and the ExtentWidth minus the ViewportWidth. The returned value is described in Device Independent Pixels.
**
精彩评论