I use Object tag like this.
////////////////////////////////////////////////
<div id="silverlightControlHost">
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%">
<param name="source" value="ClientBin/MyProject.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="EnableHtmlAccess" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
/////////////////////////////////////////////////////////////////////
this is auto-generated code.
I tried a test in the local server.
I changed source param, like this.
<param name="source" value="http://othersite.com/MyProject.xap"/>
and I added some codes in my project.
Because of 'EnableHtmlAccess' param, 'HtmlPage.Window.Alert' or 'HtmlPage.Window.Confirm' methods work.
but still 'HtmlPage.Plugin.AttachEvent("onmousewheel", this.HandleMouseWheel);' Command doesn't work.
I can't get any event from 'HandleMouseWheel' Handler.
also, I cannot accept any event from 'WebClient' class. for example, 'OpenReadcompleted', 'DownloadStringCompleted', etc..
In addition, this's my Page.xaml.cs code.
public Page()
{
InitializeComponent();
HtmlPage.Plugin.AttachEvent("DOMMouseScroll", this.HandleMouseWheel);
HtmlPage.Plugin.AttachEvent("onmousewheel", this.HandleMouseWheel);
WebClient wc = new WebClient();
wc.DownloadStringAsync(new Uri("{Some Path..}", UriKind.Relative));
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
}
private void HandleMouseWheel(object sender, HtmlEventArgs args)
{
HtmlPage.Window.Alert("Wheel?!!");
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
HtmlPage.Window.Alert("down?");
}