implementing MVVM

Discussion created by ankita_bhatia01 on Jul 3, 2013
Latest reply on Jul 9, 2013 by ankita_bhatia01
I have been experimenting with various ideas to implement MVVM for the map control in a component.
The best way in the scenerio we are implementing would be to bind each graphic of my graphic collection, to a viewmodel of its corresponding object type.
Eg: if I wish to represent a network of routers and client computers and their connections, I would create a viewmodel (according to type) for each of them and bind them to the Graphic that represents them.

The problem that I face now is, I can not figure out how to bind each Graphic to a ViewModel as there is no DataContext property for a Graphic or a MarkerSymbol (Symbol base class).

So the graphic that is displayed on the Map (Framework element) is not a framework element/Control.

Please correct me if I am wrong.
If not,any thoughts on how to accomplish this.
My major aim is to keep the entity -> represented by each graphic in my ViewModel and to be able to work on its properties without adding a lot of attributes to a Graphic.