Javascript/Silverlight proxy double load delay -
I am creating a Silverlight application that will be heavily javascript.
To enable JS interaction, I have created the following SL squares:
[scriptable type] public class JavaScriptProxy {private string _version; // Available for testing of SL-JS integration [scriptablemember] non-public smoke test (HtmlPage.Window.Alert ("Hello World!"); }} and loaded on the main SL application's constructor:
public app () {this.startup + = this.onstartup; This.Exit + = this.Application_Exit; This. Translated exception + = this.Application_UnhandledException; InitializeComponent (); // Register Javascript bridge proxy // (must be registered in constructor so proxy is available instantly) HTMLPage. Registerable object ("jsproxy", new javascript proxy ()); } However, because it is a javascript-heavy app, it can be loaded via javascript only.
Something along with I.e:
. Is called on Function init () {var proxy; Var el = document.getElementById ("target_canvas"); Silverlight.createObject (..., el, "agapp" ..., {onLoad: function () {proxy = agapp.Content.JsProxy; // *** This line is ok *** Proxy .Mocost (); }}); // *** This line fails (of course) *** proxy.SmokeTest (); } However, it increases the error because agApp.Content.JsProxy is not fully available unless the Silverlight Onload event is removed, Thus the JsProxy field is unavailable.
How can I create Silverlight Frequency as access to JSPROXX Instant ? Some things while (_mutex); Probably a bad idea.
I was because of this because there will be another layer of intangible construction on the creation of examples of Silverlight app, so that the function can load all the SL content at one time.
It is working on different threads due to the Silverlight and Javascript. Although you have asked the browser to request to load the Silverlight control, it does not wait to finish the Silverlight before loading before the next line.
You can access JS proxies only after Silverlight, you have turned it on so that you can wait for the fire to the download event (but only full Silverlight.exe is completely full) Or later, you request RegisterScriptableObject a JavaScript method called yYourJSProxyNameLoaded () which will keep you back with inline
HTH
- Scott Barnes / Rich Platform Products Manager / Microsoft.
Comments
Post a Comment