Imagine n buttons on the page, each opening up a div on-click. There is in fact a single div, which gets re-associated to each button on click. I want the data on the div to be binded to the ViewModel instances for each button.
I don't know if I'm on the right path but so far I have an instance of the VM object connected to each button. When button x is clicked I can get its corresponding VM and re-applyBinding to the div. In this case I need to decouple the old binding -which I'm not sure how to do.
My approach seems fine to me, but that could be because I come from a C#/Java background and treat everything as objects and references. Maybe there is a better way?