-1

I have a tree view that displays a structure of agenda items. The tree structure is merely for ui and usability purposes. The tree view is “flattened” into a linear list of agenda items. When an item is selected in the tree view, I would like to scroll the corresponding linear list item to the top of the listview. The items in the listview are custom user controls. I would like to use an attached behavior since I need to stay within MVVM. I have manly to issues. I need to be able to inject an index into the view and trigger the scroll itself by a command. Any ideas? Kind regards

This approach seem feasible but Im not getting how to pass an index to a behavior. https://marcominerva.wordpress.com/2014/09/30/scrolltobottom-behavior-for-listview-in-mvvm-based-universal-windows-apps/

Weirdmind
  • 19
  • 5

1 Answers1

0

This StackOverflow question should help you: mvvm how to make a list view auto scroll to a new item in a list view

You shouldn't need to deal with an Index if you're using MVVM, just use the selected item instead. Ideally, your TreeView and ListView should be binding to the same items.

Keithernet
  • 2,349
  • 1
  • 10
  • 16