TreeView BringIntoView with MVVM

c#, mvvm, treeview, wpf

Solution

The problem can be solved with an Behavior.

This CodeProject article describes it very good and it works out of the box.

Problem

I want the user to be able to search for Items in a TreeView. After entering a searchtext the TreeViewItem should be scrolled into view. Right now I am using the MVVM Pattern for the TreeView, for the TreeViewItems and the MainView. What do I have to do to get the functionality of BringIntoView utilizing MVVM? Is there some property I can bind? (in MFC there was something like FirstVisibileItem) Have seen a "solution" with a behavior. Is it really necessary?

Original source