Tuesday, July 17, 2007

First Silverlight App's

I haven't got very long 2nite, so I need to keep this relatively brief...

10:06pm - I recreate the first silverlight app I created..... except its no longer in a static html page, instead its embedded on the dev optusZOO portal as an optional module. I wonder if the exec producer will want to publish this one.....



10:20pm - My lovely girlfriend arrives home, 2 gourmet pizzas in one hand, and a tiramisu for desert in the other

10:50pm - I've finished my dinner (it was lovely btw), and also recreated the 2nd silverlight app I had created. A dodgy looking (but funcitonal) inline WMV player, again, integrated into the optusZOO portal



I think the ninemsn design jobs are fairly safe =S

There is very little required to create these very simple app's. 3 steps infact:
1. Create a standard html file, and include the silverlight.js from the silverlight SDK available here

2. create a basic xaml file containing the layout elements, you can create this in VS2008, Blend, or notepad. For my first app I named this file "Demo1.xml". It is not a necessity to use .xaml as the file extension, as you can see in my example below I merely used the .xml file extension. This was my preference as my text editor recognises files with the .xml extension and performs all my indenting.


3. within your page, make reference to the 'Sys.Silverlight.createObjectEx()' function. In this call you specify the location of the xaml file "Demo1.xml", and pass a reference to the div where you want the silverlight app to be rendered. These are not the only parameters required, however at this point im trying to express how very easy it is to get started.



As I mentioned in my first post, there are a lot of very good blogs available. The information for these two app's I picked up from tutorials on Dave Campbell's "Getting Started" blog, and the WPFE.chm (help file?!?!) contained in the silverlight1.1 SDK package.

Thats all for now, if you would like any more information on these app's plese let me know. Also in the future I will more detailed in my explanations, i'm under some time contraints this evening unfortunately.

nite =)

No comments: