Dec 3, 2012 at 12:29 PM
Edited Dec 3, 2012 at 12:33 PM
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")
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?