Hi,
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
publicvoid ChangeActiveItem(ListboxItem selecteditem) { if(selecteditem.Name == "FirstMenuItemText") ActivateItem(ViewModelWhichShouldBeActiavted) .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?