ListCollectionView has a property get the current position (CurrentPosition):
http://msdn.microsoft.com/en-us/library/system.windows.data.collectionview.currentposition.aspx
But this property is read-only.
Gets the ordinal position of the CurrentItem within the (optionally sorted and filtered) view.
So how can one set the current position? I hope this doesn't involve behaviors...
I need to scroll to the top of a ListView or DataGrid and it seems to me it ought to be possible to easily set a property such as that one to achieve it, without going into the guts of a view.
Thanks in advance.
Update:
This is my own workaround at the moment - but it's kind of disguisting - when one wants to use MVVM (using F#):
let linesControl = context.Window.FindName("ObjectListView") :?> ListView
let scrollBorder = VisualTreeHelper.GetChild(linesControl, 0) :?> Border
let scrollViewer = scrollBorder.Child :?> ScrollViewer
scrollViewer.ScrollToVerticalOffset(0.0)