Thank you Charles and Patrick!
I add the codes to allow javascript talks to the silverlight application. But my problem is after the map zooms, the silverlight application refreshes, and the map extent goes back to the full extent. Any idea? Thanks!
Here is the code I use:
MainPage.xaml.cs:
namespace SilverlightApplication
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
HtmlPage.RegisterScriptableObject("Page", this);
...
}
....
[ScriptableMember]
public void MapZoom(double x1, double y1, double x2, double y2)
{
map.ZoomTo(new ESRI.ArcGIS.Client.Geometry.Envelope(x1, y1, x2, y2));
}
}
}
Javascript:
function zoommap() {
var MapPlugin = document.getElementById("SLP");
MapPlugin.Content.Page.MapZoom(3911247.03270758, 5232320.39063176, 3911547.03270758, 5232920.3906317);
}