NML is considered by Microsoft as the leading provider of Silverlight skills in South Africa.
We recently gave a talk at Sanlam on Silverlight. We recorded the presentation and I got Elle to create an abridged transcript of the talk [she wasn't very happy with me].
Gareth Saul – Why
Rogan Flitton – What
Debbie Derman – How
Gareth ( http://twitter.com/garethsaul )- What is Silverlight? 1/2
In order to build rich applications deployed through the browser, you have two options: Flash and Flex or Microsoft Silverlight.
Flash is on 95% of machine today – if you are predominantly concerned about portability and accessibility then use Flash.
Silverlight is on only about 35% of machines, but Microsoft is heavily pushing to increase this adoption rate and it is now part of updates to Windows machines, but it is still a niche technology – this is important if looking to build deployable internet applications.
Gareth – What is Silverlight 2/2 – Caching, DataBinding, MVC, MVVM, LinQ, Limitations, Out Of Browser.
Why should we care about Microsoft Silverlight?
- Simple deployment (no installs; web-based accessibility)
- Rapid development (abstract web complexities; leveraging existing .NET capabilities)
- XAML in the browser
- Portability (1 API, 1 platform across all the different browsers)
- Easy coding
What do you need to get Silverlight on a machine?
- Silverlight pluggin (4mb download (Silverlight3); No reboot required)
- Silverlight .XAP file(serve from any web server)
- Your favourite browser
Where should you use Silverlight?
- Streaming video (high definition support; supports dynamic bandwidth scaling)
- Rich internet applications
- Line of business applications (Silverlight has a wide variety of components to assist with this: DataGrid; Charting; WCF; Isolated storage; Databinding; MVVM; LINQ)
Silverlight limitations
- Browser sandbox (no desktop integration; strict security model)
- Bulky XAP files (typical application = 800kb+ – Silverlight3 helps)
- Platform (No support for PowerPC Mac, Windows 98/2000/ME; Limited Linux support via Moonlight)
- Local storage (1mb – 25mb for out-of-browser) – can be used for anything you can come up with (it’s not limited to caching) e.g. a whole copy of a database can be brought across the wire and stored on a local machine – any interactions the clients make with the database are then synchronised backwards and forewards
Off-line modes are available – one of Silverlight3’s out-of-browser options key features is a network state connection feature so it knows when you are working in an online/offline mode
Rogan getting started with Silverlight (development environment)
Rogan – Silverlight Hello World and Model/View/View/Model Introduction
Rogan – Introduction to Model/View/ViewModel pattern
What do you need to set up the development environment?
- Visual Studio 2008/Visual Web Developer
- Download and install the Developer tools for Silverlight (including the SDK, Visual Studio project templates, and developer runtimes) from Microsoft website
- Download and install Expression Blend = an interactive user interface designing tool for designing XAML interfaces (XAML = Extensible Application Markup Language)
- Download and install Silverlight toolkit = collection of extended Silverlight controls, components and utilities – examples included are: TreeView, AutoCompleteBox, Charting, etc (not a minimum requirement, but highly recommended). Important to note is that this is not a 3rd party toolkit, but it is rather fully supported by Microsoft – as they continuously develop the Silverlight framework they are building a more complex and wider set of user controls in order to support it.
- Open Visual Studio – select “New Project” – Visual Studio now allows you to select “Silverlight application”.
- Select/Create a folder in which you wish to work – now you have a XAP file, which goes into the ClientBin folder.
- It then asks where you would like to host this application and then in the right hand bar, you will see that is has created a new website along with a default page, a Silverlight application, and a couple of XAML files and some code behinds.
- The code behind the application is straight C# code.
- For bigger projects it is recommended that you use a model view, view model framework, so your code is a bit neater and easier to work with – split solution into views, view models, interfaces and implementations
Debbie (http://twitter.com/debbiederman)
Building a Silverlight UI with Blend (1/3)
Building a Silverlight UI with Blend (2/3)
Building a Silverlight UI with Blend (3/3)
Development and Design
With Blend3 and Silverlight, it is possible for the developers and designers to work simultaneously and seamlessly, as the UI and data models are completely separate elements, which can be fused together through DataBinding at any point.
In order for the designers to create the design, especially for controls, they need to have something to bind to but if the models are not yet ready, then there is nothing for them to load into the data control so there is a concept of Design Time Data.
Design Time Data
| PROS | CONS |
| Designers don’t need a whole development environment/setup | Incorrect binding names – runtime bugs (be very specific with your binding names) |
| Timing – development doesn’t need to have started before the designers begin | Designers may get carried away and create their own data models, which will not match up with the developer models – probably best for the developer to help the designer create some dummy data to start with |
| Conditional compilation – during production, it knows not to use the design time data | |
| Great for quick demos |
Default Basic Project Structure
App.xaml – very key element because stores application wide resources
Main.xaml
ClientBin folder to host .xap file
Default.html – contains Silverlight object (can add initParameters to pass parameters to Silverlight object)
Blend
Each style has a target type property/attribute so you can’t apply a style made for a text box to anything other than a textbox
Silverlight Resources on the Web
http://www.codeplex.com/Silverlight
http://blogs.silverlight.net/blogs/msnow/
http://weblogs.asp.net/scottgu/
One Response to “NML presents Silverlight to Sanlam”

Well done guys! Very professional.