Any good way of setting the activateitem when usingmultiple listboxes as the criteria

Topics: Conventions, Getting Started
Dec 3, 2012 at 11:29 AM
Edited Dec 3, 2012 at 11:33 AM


I have a view which has several listboxes and a contentControl called ActiveItem. The listboxes and their items are decoratively created.

the selection changed is handled like this

[Event SelectionChanged] = [Action ChangeActiveItem($this)]

the viewmodel consists of multiple viewmodels, one for each listbox item.


the way this is currently handled is something like 


public void ChangeActiveItem(ListboxItem selecteditem)

   if(selecteditem.Name == "FirstMenuItemText")
 .if (..)


this seems like a rather error prone and bad way of achieving the goal.  One thing i did try was bind the Tag-property of each listbox-item to the child viewmodel which the item should activate. But that doesn't seem to work - the Tag property is null.
Are there any good ways of achieving this?