I've been looking into Silverlight in my spare time a bit, to see what it has to offer, and the JavaScript "Interop" is actually pretty neat and simple to use. About three months ago I wrote a post titled "Working with HTML DOM in Silverlight using the Bridge Pattern"; so I think this time I'll go over some of the basics involved with communicating back and forth between Silverlight and JavaScript. This article is written by referencing Silverlight 2 Beta 2, but should still hold relevent in the final release of Silverlight 2. Call a JavaScript Methods from within Silverlight1) Using the Eval methodSilverlight does expose the JavaScript Eval method, so you can use it to call some JavaScript in the page2) Using the Invoke method You can use the Invoke method to execute some global JavaScript method within your page.Returning Values From JavaScript Method Calls
Returning Objects From JavaScript Method Calls and Accessing Its Methods and Properties
Call Silverlight Methods From JavaScriptRead more: Chris Pietschmann
Returning Objects From JavaScript Method Calls and Accessing Its Methods and Properties
Call Silverlight Methods From JavaScriptRead more: Chris Pietschmann
0 comments:
Post a Comment