views:

23

answers:

0

Here is the scenario. I'm having a List in my view model and I want to generate a toolbar - each button representing a CustomObject which will have the tooltip, icon etc.

I'm defining a template to display CustomObject in a toolbar button and also define the toolbar button ItemSource to the viewmodel collection and ItemTemplate to the one defined.

In addition I'm having another propery in the view model SelectedCustomObject which should represent the object clicked in the toolbar and requires a two-way binding too.

I'm not able to achieve setting this property on the view model through binding. To summarize, how can I bind the togglebutton click to set the SelectedCustomObject property in the view model through binding?