I am adding a ScrollViewer around my TreeView for 2 reasons:
-
i want more control over the way my TreeView scroll bar looks
-
i want more control over my TreeView scroll bars position, because i want to synchronize a few tree views.
it seems that as soon as i add a ScrollView around TreeView, i lose the ability to scroll it using mouse scroller.
I guess my question is 2 part. Do i gain anything by adding my own ScrollView, and is this behavior by design?
I don’t think either of your requirements precludes using the
ScrollViewerthat is within theTreeViewtemplate. You might need to re-template theTreeViewto achieve your goals.This also sheds light on why your scrolling doesn’t work as expected. You’ve effectively got a
ScrollVieweraround aScrollViewer. What you would need to do for that to work is either remove the ScrollViewer from the TreeView template, or disable it:That said, I do think the better option in your case may be to re-template/re-style the
TreeViewitself.