Silverlight
< Licenta
< eduardstanculet
Get flash to fully experience Pearltrees
Rating: 8 user(s) have rated this article Abstract: Silverlight 2 is a great technology to build business centric applications, and one of the coolest features is the ability to call JavaScript functions from your Silverlight code. The following article demonstrates how to use call JavaScript from Silverlight 2.
Introduction Microsoft® Silverlight TM is a cross-browser, cross-platform plug-in for delivering the next generation of .NET-based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications.
The following example shows how to mark properties, events, and methods as scriptable by using the ScriptableMemberAttribute attribute. public class MyStockWatcher { [ScriptableMemberAttribute] public string SomeProperty {get; set;} [ScriptableMemberAttribute] public event EventHandler SomeEvent; [ScriptableMemberAttribute] public string DoWork(int count); } You can explicitly register an instance of a scriptable type with the runtime by using the RegisterScriptableObject(String, Object) method.
All the Silverlight code and examples were created using the 1.1 Alpha Refresh.