I'm implementing the MVVM pattern in a Silverlight Application that utilizes 3rd party software (ESRI's Silverlight API). This 3rd party control only exists in the XAML:
<esri:Map x:Name="map" ... />
The ViewModel has an ObservableCollection of object which are bound to a ListBox. When a user double clicks on a specific item, the Model (which is bound to a user control inside that ListBox) fires an event which the "Main" view model is subscribed to.
My question is, in the "Main" ViewModel where the esri:Map resides, how do I call functions from this 3rd party control with data from the event (ex. map.ZoomTo( result ); )? The only solution I have so far is to move the event code (in the ListBox user controls) from the ViewModel into the Code-Behind and then subscribe to those events in the "MainPage" xaml and fire the code in the code behind.
Is this the best option utilizing the MVVM pattern??