Did You Know That… createObjectEx is really just a wrapper around createObject?

As Adam Nathan points out In Silverlight 1.0 Unleashed, Silverlight.createObjectEx is implemented as a function that takes an array as an argument and calls Silverlight.createObject, passing each element of the array in turn.

The reason that many Silverlight programmers prefer to use Silverlight.createObjectEx is that it is relatively self-documenting, and that it is essentially JSON.

Silverlight.createObjectEx({
        source: "Scene.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "800",
            height: "600",
            version: "0.9"
        },

Note: Using the suffix, Ex is a holdover from the days of COM when interfaces were never changed, and so, if an interface was extended its name was often modified by adding Ex (for extended).

About Jesse Liberty

Jesse Liberty is an independent consultant and programmer with three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Xamarin Certified Mobile Developer and a Xamarin MVP, Microsoft MVP and Telerik MVP.
This entry was posted in z Silverlight Archives and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *