Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Clarion Technologies Pvt. Ltd.

Silverlight
Guide

Confidential Page 1 of 6
Clarion Technologies Pvt. Ltd.
TABLE OF CONTENTS

TABLE OF CONTENTS ..........................................................................................2


INTRODUCTION...................................................................................................3
BROWSER COMPATIBILITY.................................................................................3
SILVERLIGHT CONTROLS.....................................................................................4
A Note On The Design Surface...........................................................................5
Layout Controls...............................................................................................5
1. Grids..........................................................................................................5
2. StackPanels.................................................................................................6
3. Canvas.......................................................................................................6
USEFUL LINKS ....................................................................................................6

Clarion Technologies Pvt. Ltd


4th Floor, Great Eastern Plaza, Airport Road, Pune- 411 006,Maharashtra, INDIA. 2
INTRODUCTION

The announcements around Microsoft’s new Silverlight platform were important


to anyone who is thinking about where the web will evolve. Silverlight will be
the platform of choice for developers who build rich Internet applications. It
makes Flash/Flex look like an absolute toy.
Most impressively, Silverlight is very small (4 MB) and very fast (it blows away
native Javascript routines - without exaggeration, Ajax looks like a bicycle next
to a Ferrari when compared to Silverlight).
It is being designed to work in conjunction with XAML and is scriptable with
JavaScript. XAML can be used for marking up the vector graphics and
animations. Textual content created with Silverlight is searchable and indexable
by search engines as it is not compiled, but represented as text (XAML).
Silverlight can also be used to create Windows Sidebar gadgets for Windows
Vista.
Silverlight is made up of the following components:
Input – handling input from devices like keyboard, mouse, stylus etc.
UI core – managing rendering of bitmap images (including compressed raster
images like JPEG), vector graphics, text and animations.
Media – playback of MP3, WMA Standard, WMV7, WMV8 and WMV9/VC-1
streams.
XAML – to allow the UI layout to be created using XAML markup language.

Silverlight ships with a lightweight class library which includes features such as
extensible controls, XML Web Services, networking components and LINQ APIs.
This class library is a subset of, and is considerably smaller than, .NET
Framework's Base Class Library. Silverlight code runs in a sandbox, thus
preventing the invocation of platform APIs. Silverlight can handle data in RSS
or JSON format, in addition to XML. Silverlight also includes classes for data
access over XML-based Web services, REST, WCF Services and ADO.NET Data
Services. Silverlight 2 also allows limited filesystem access to Silverlight
applications. It can use the operating system's native Open-file dialog box to
browse to any file (to which the user has access). Silverlight CoreCLR uses an
attribute-based security model, as opposed to the Code Access Security (CAS)
model of the desktop version of .NET Framework.

Silverlight 3 will feature support for H.264 video and AAC audio decoding.

BROWSER COMPATIBILITY

Silverlight is compatible with multiple web browser products used on Microsoft


Windows and Mac OS X operating systems. Mobile devices, starting with

Clarion Technologies Pvt. Ltd


4th Floor, Great Eastern Plaza, Airport Road, Pune- 411 006,Maharashtra, INDIA. 3
Windows Mobile 6 and Symbian (Series 60) phones, will also be supported in
near future.

SILVERLIGHT CONTROLS

Silverlight 2 Beta 2 has over 3 dozen User Interface (UI) controls and the final
release will have more. .NET programmers already familiar with ASP.Net or
(especially) WPF, will find using the Silverlight controls very natural and
straight forward.

Silverlight Controls (split in two to make it easier to view)

Silverlight controls were created to look great and provide extensive and
customizable functionality right out of the box. Moreover, all of the standard
controls can be modified in numerous ways to meet your needs.

Clarion Technologies Pvt. Ltd


4th Floor, Great Eastern Plaza, Airport Road, Pune- 411 006,Maharashtra, INDIA. 4
The look and feel of the control can be tweaked through styles or can be
entirely redesigned through templates, and the behavior of the controls can be
modified through event handlers. In the rare cases when none of that is
enough, you can create (or derive) your own customized controls as well.

A Note On The Design Surface

For version 2 of Silverlight in Visual Studio 2008, the design surface is "read
only." That is, you can drag and drop controls into the markup (or write the
Xaml by hand) and the effects are seen immediately in the design surface, but
you cannot yet drag or otherwise manipulate controls directly in design mode.

This is a temporary limitation. However, Microsoft provides another set of tools


called “Expression Studio” for silverlight designers, where designing possibilties
are unlimited.

Layout Controls

The use of layout controls is both straight-forward and essential to the creation
of Silverlight applications. Layout controls are used to manage the placement
of other controls (including other layout controls!) in your Silverlight
application. You can think of the layout controls as “containers.”

The three Layout controls you'll use most often are:

1. Grid – essentially a table used for positioning objects in rows and


columns.

2. StackPanel - used to position objects next to one another, or atop one


another.

3. Canvas – used for absolute positioning (and unchanged from Silverlight


1.0)

They are listed in the order of how frequently they are used. If you learn Grid
and StackPanel, you can probably program for a long time on just those two.

1. Grids

Grids (not to be confused with DataGrids) offer easy and exact placement by
providing a table-like structure. You declare rows and columns, and then place
controls into a specific row/column location (spanning across rows or columns
as needed). While you can tweak your grids to achieve very precise placement,
the basic use of grids is extremely straight forward. You typically declare a
grid, declare its rows and columns and then start placing controls into specific
cells (e.g., column 1, row 3).

Clarion Technologies Pvt. Ltd


4th Floor, Great Eastern Plaza, Airport Road, Pune- 411 006,Maharashtra, INDIA. 5
2. StackPanels

StackPanels are typically combined with other layout controls. They allow you
to stack objects one on top of the other, or next to each other (like books on a
shelf). One convenience of a StackPanel is that you do not have to provide the
position of the objects held by a StackPanel, they are positioned relative to the
object declared earlier in the Stack.

3. Canvas

The Canvas layout control is the most basic, and it has been around since the
very first Silverlight versions. It provides the simple ability to absolutely
position child elements relative to the canvas' top left corner.

To see this at work, let's create our first Silverlight Application: Grid For
Layout (Refer “Silverlight_Sample_Application.doc”)

USEFUL LINKS

1) http://www.microsoft.com/silverlight/

2) http://silverlight.net/

3) http://en.wikipedia.org/wiki/Silverlight

4) http://weblogs.asp.net/scottgu/archive/2007/05/07/silverlight.aspx

5) http://download.microsoft.com/download/f/2/e/f2ecc2ad-c498-4538-
8a2c-15eb157c00a7/SL_Map_FinalNET.png

Clarion Technologies Pvt. Ltd


4th Floor, Great Eastern Plaza, Airport Road, Pune- 411 006,Maharashtra, INDIA. 6

You might also like