inland empire .net user's group silverlight class

18
Silverlight 4 Course 1.Introduction to Silverlight 2.Layout 3.Input Handling 4.Applications, Resources, Deployment 5.Data Binding, View Model 6.Out of Browser, File Access, Printing 7.WCF RIA Services (4 Weeks )

Upload: iedotnetug

Post on 07-Nov-2014

1.144 views

Category:

Technology


3 download

DESCRIPTION

Slides from the first Silverlight 4 class taught by the Inland Empire .NET User's Group

TRANSCRIPT

Page 1: Inland Empire .NET User's Group Silverlight Class

Silverlight 4 Course

1. Introduction to Silverlight

2. Layout

3. Input Handling

4. Applications, Resources, Deployment

5. Data Binding, View Model

6. Out of Browser, File Access, Printing

7. WCF RIA Services (4 Weeks )

Page 2: Inland Empire .NET User's Group Silverlight Class

Introduction to Silverlight

Agenda 

1.What is Silverlight ?2.Evolution of Silverlight3.Getting Started4.Silverlight VS WPF5.Core Controls6.Anatomy7.Demo

Page 3: Inland Empire .NET User's Group Silverlight Class

Silverlight 4• Cross browser plugin – IE (Active/X), FireFox

(NSAPI), Chrome, Safari (WebKit) 

• Cross platform – Windows, MAC (Intel Only) and Linux using Moonlight (Delayed)

 • .Net programming language (C#, Visual Basic, …)

and runtime

• Works with Javascript and HTML DOM• Not mutually exclusive

• Mobile platform : Windows 7 Phone, Nokia Symbian OS

• RIA : User interaction and Animation

  

Page 4: Inland Empire .NET User's Group Silverlight Class

History• .Net Programming for client server web.

• Javascript to provide client side interactivity.

• Crippled because of Javascript compatibility.

• Microsoft wanted better control just like Java Applets.

• So came Silverlight. Initially known as WPF/E.

• WPF History : GDI & USER, DirectX, XP’s GDI+

Page 5: Inland Empire .NET User's Group Silverlight Class

Silverlight Evolution

• SL 1 : Graphics, hi-def media, script, text

 • SL 2 : . Net Framework • SL 3: OOB, Data binding, Common

Controls, Deployment : LOB • SL 4 : Printing, COM Automation,

Trusted Apps, Multi touch, Webcam & Mic, Mouse right click

   

 

Page 6: Inland Empire .NET User's Group Silverlight Class

Getting Started• Install using Web Installer : http://www.microsoft.com/web

Installs Web Server, Frameworks and Runtimes, Database and Tools.

• Install Visual Studio 2010 Express (SL 3)• http://www.microsoft.com/express/Web

• Install Silverlight Tools (SL 4)• http://www.silverlight.net/getstarted

  

 

Page 7: Inland Empire .NET User's Group Silverlight Class

Silverlight VS WPF• Different implementation :  Same Basic Technology

 • Web vs Desktop

 • Subset Vs Superset of .Net Framework

• Mostly the same team works on both.

• Use #ifdef if targeting both.

• WPF features Full Hardware Acc, Drawing Types, Event tunneling.

• Silverlight Features Browser Integration, Video Brush, Deep Zoom

    

 

WPFSL

Page 8: Inland Empire .NET User's Group Silverlight Class

XAML

XML Application Markup Language 

o Declarative language to describe UI.o XML Rules apply. Don’t forget />o Pronounced like Zammel.o Expression Blend Tools support it.o CAMLo BAMLo Can call Javascript function for

splash screen functionality.  

Page 9: Inland Empire .NET User's Group Silverlight Class

XAML• Element : Corresponds to CLR object

<Button>

<Button.Content>

Cancel

<Button.Content />

<Button>

• Attribute : Corresponds to Properties, events

<Button Content=“Cancel” Click=“fn” />

• Namespaces

xmlns:x=“http:/…..”

…<Button x:Name=“mybtn” />

Page 10: Inland Empire .NET User's Group Silverlight Class

XAML

• Type Converter<Button Background=“Red” />

Here Red gets converted to a SolidColorBrush because of Type Converter.

• Markup extension {}<TextBlock text={Binding …. } />

Page 11: Inland Empire .NET User's Group Silverlight Class

Silverlight project types

• Silverlight Application : stand alone

• Silverlight Navigation : Multiple pages URI Map

• Silverlight Class Library : reuse common code

• Silverlight Business Application : RIA Services

• WCF RIA Services Class

• Unit Test Application : Added to existing SL Proj– Demo [Show in Visual Studio]

Page 12: Inland Empire .NET User's Group Silverlight Class

Core Controls and EventsSL Runtime, SL SDK, SL ToolKit

• Button• CheckBox• RadioButton• TextBox• Image• ComboBox• ListBox

• Clicked• Checked/Unchecked• GroupName Property• TextChanged• Stretch Property• Items Property• SelectionChanged

Page 13: Inland Empire .NET User's Group Silverlight Class

DEMO • Create Hello World

  Enter Name:  Hello World, John

•Create all elements, events from both XAML and CS•Hook to Javascript function. (No x:class )•Talk about X:Name X:Class•Show Document Outline / bread crumb in XAML view.•Open project in both Blend and VS.

John Greet

Page 14: Inland Empire .NET User's Group Silverlight Class

Anatomy• Object tag

• XAP Files in ClientBin

– Zip file

• Host project to host the html page

Page 15: Inland Empire .NET User's Group Silverlight Class

References

• Silverlight.net

• Channel9.msdn.com

• Silverlight cream

• Quick starts

Page 16: Inland Empire .NET User's Group Silverlight Class

Class Project

• Create an oval. Fill color Red.• On Mouse enter change Fill color to

Blue• On Mouse exit change color to Green• On Mouse click change color to

Purple.  

 

RedBlue

Green

Color: Radio ButtonOval or Rect

Combo BoxOval or Rect

Page 17: Inland Empire .NET User's Group Silverlight Class

• As Microsoft says :

– Light up the WEB

• As Obi Wan Kanobi says it :

Page 18: Inland Empire .NET User's Group Silverlight Class

• “Use the light, Luke”