I am not exactly clear on what you are describing with how the map is exposed in you view model. You descriptions sounds as though you have a Layers collection on the ViewModel that is bound to the map in Xaml. Something along these lines below.
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" Layers="{Binding MapLayers}">
I have found that it is pretty much impossible to really create an ESRI Silverlight API application without exposing the Map object to the ViewModel, there are just too many things that need the Map object. What I do is have my main page implement an interface that exposes the Map.
public interface IMapView
{
Map Map { get; }
}
I use Dependency Injection (I use MEF, Unity is another Microsoft option) to get my IMapView object into my ViewModels. I don't actually have a ViewModel attached to the MainPage, instead my MainPage is made of numerous views each with it's own ViewModel.From here I would have a View (some kind of toolbar in this case) with an attached ViewModel. For a good navigation tool you kind of need toggle buttons, in my opinion. I have made those as custom controls that inherit from RadioButton. RadioButton because it already includes the behavior of only one being selected at a time, compared to core ToggleButton. There are a few ways to wire the commands, the most straight forward is to have the ViewModel expose an ICommand for each button and a bool for the IsSelected property. Something similar to below
<Buttons:MyToggleButton Text="{Binding Path=LanguageResource.ButtonText, Source={StaticResource LocalizedStrings}}"
IsChecked="{Binding ZoomInIsChecked, Mode=TwoWay}"
Click="{Binding ZoomCommand}" CommandParameter="ZoomIn" GroupName="ZoomButtons"/>
[Import]
public IMapView MapView {get;set;}
private ICommand _zoomCommand;
public ICommand ZoomCommand
{
get { return _zoomCommand?? (_zoomCommand= new DelegateCommand<string>(ExecuteZoomCommand)); }
}
private void ExecuteZoomCommand(string zoomType)
{
//Here would be my zoom logic
}
Something along those lines ties the Command to the view modelHope that helps
Thanks,
-Joe