I would like to add an GMap.NET control to my WPF MVVM application. However I am new in MVVM and I do not know how to manage (add markers, changing map provider) my control without reference to its name from View.
For now on I'm doing it like that:
gmap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance; GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly; gmap.DragButton = MouseButton.Left; gmap.SetPositionByKeywords("Paris, France"); gmap.ShowCenter = false;
but how to adjust it to MVVM? I will be grateful for solutions, links, references, etc...
[EDIT] For now on I've came up with an idea to create all GMap.NET control in ViewModel and bind whole control like: <UserControl Content="{Binding GMapC}"/>
I would like to add an GMap.NET control to my WPF MVVM application. However I am new in MVVM and I do not know how to manage (add markers, changing map provider) my control without reference to its name from View. For now on I'm doing it like that:
gmap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance; GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly; gmap.DragButton = MouseButton.Left; gmap.SetPositionByKeywords("Paris, France"); gmap.ShowCenter = false;
but how to adjust it to MVVM? I will be grateful for solutions, links, references, etc...[EDIT] For now on I've came up with an idea to create all GMap.NET control in ViewModel and bind whole control like:
<UserControl Content="{Binding GMapC}"/>