What you need is to listen to the each Map's ExtentChanging event, and whenever one map zooms in/out, all others responding the same way.The key point is to avoiding endless loop by deciding the whether the new extent is the original one.Here is the sample and key code.http://newnaw.com/pub/sl/googlemapvsbingmap.htmlpublic MainPage()
{
InitializeComponent();
map1.ExtentChanging += new EventHandler<ESRI.ArcGIS.Client.ExtentEventArgs>(map_ExtentChanged);
map2.ExtentChanging += new EventHandler<ESRI.ArcGIS.Client.ExtentEventArgs>(map_ExtentChanged);
map3.ExtentChanging += new EventHandler<ESRI.ArcGIS.Client.ExtentEventArgs>(map_ExtentChanged);
map4.ExtentChanging += new EventHandler<ESRI.ArcGIS.Client.ExtentEventArgs>(map_ExtentChanged);
//map3.ViewChangeEnd+=new EventHandler<Microsoft.Maps.MapControl.MapEventArgs>(map_TargetViewChanged);
this.Loaded+=new RoutedEventHandler(MainPage_Loaded);
}
...
private void map_ExtentChanged(object sender, ESRI.ArcGIS.Client.ExtentEventArgs e)
{
if (e.OldExtent != null)
{
ESRI.ArcGIS.Client.Map map = sender as ESRI.ArcGIS.Client.Map;
switch (int.Parse(map.Name.Substring(3, 1)))
{
case 1:
if (!AreEqual(map2.Extent, e.NewExtent, 0.000000001))
{
map2.Extent = e.NewExtent;
map3.Extent = e.NewExtent;
map4.Extent = e.NewExtent;
}
break;
case 2:
if (!AreEqual(map1.Extent, e.NewExtent, 0.000000001))
{
map1.Extent = e.NewExtent;
map3.Extent = e.NewExtent;
map4.Extent = e.NewExtent;
}
break;
case 3:
if (!AreEqual(map4.Extent, e.NewExtent, 0.000000001))
{
map1.Extent = e.NewExtent;
map2.Extent = e.NewExtent;
map4.Extent = e.NewExtent;
}
break;
case 4:
if (!AreEqual(map3.Extent, e.NewExtent, 0.000000001))
{
map1.Extent = e.NewExtent;
map2.Extent = e.NewExtent;
map3.Extent = e.NewExtent;
}
break;
}
}
...
private static bool AreEqual(Envelope e1, Envelope e2, double tolerance)
{
return
Math.Abs(e1.XMin - e2.XMin) < tolerance &&
Math.Abs(e1.YMin - e2.YMin) < tolerance &&
Math.Abs(e1.XMax - e2.XMax) < tolerance &&
Math.Abs(e1.YMax - e2.YMax) < tolerance;
}