Upload
coolajju143
View
323
Download
0
Tags:
Embed Size (px)
Citation preview
Silverlight
• What the heck is Silverlight?– Web Platform for Rich Interactive Applications
• Web Platform is a euphemism for Plug-in
• Wow factor stuff like vector-based graphics , animations, audio and video integration
• Cross browser, cross platform (!)
• It’s a stand-alone framework. Not dependant on any prior .NET version. Clients need nothing but the plug-in.
• Sounds familiar…– Doesn’t Macromedia (er…Adobe) already give this to us?
Its called Flash?• Well…kind of. But Silverlight is better. Trust me.
Why Now?
• HTML + CSS + JavaScript is too limiting
• The Browser as a development platform is, well, less than ideal
• More applications are becoming web-ified, but at the cost of user experience
• End user expectations are changing. They want richness and interactivity (yes, even in LOB’s)
Great...
• So another platform I have to learn…
– Sort of…but you get to leverage a lot of your existing skills• UI parts are based on .NET 3.0 (read ‘XAML’)
• Programming model is JavaScript
• Feels good to both rich client and web developers
And so as not to confuse you
• There really are two platforms
• Two versions of Silverlight currently available
– 1.0• Does the basic XAML stuff, but still requires you to work (sorry)
• JavaScript is the programming model…feels warm and cozy to web developers
• ~ 2 MB download
– 1.1 Alpha• Does way more XAML-ish stuff (less work for you )
• Brings in a managed programming model (woot!)
• Silverlight + .NET Alpha ~ 4 MB (cross platform)
Obligatory Architecture Diagram
Browser Plug-In
Presentation Runtime
Presentation Core
Media Support (Audio/Video)
XAML
Native DOM API JavaScript DOM API
Operating System (Windows, Mac)
Silverlight 1.0
And it runs on Windows too!
• Browsers
– Internet Explorer 6 and 7 (Windows)
– Firefox 1.5.0.8, 2.0+ (Windows and Mac)
– Safari 2.0.4+ (Mac)
– Opera (through Mono implementation)
• Operating systems
– Windows XP SP2, Vista
– Mac OS X (10.4.8+)
– Mono Project working on Linux implementation
So what’s in the bag?
• 1.0 Major Features
– XAML Subset:• 2D Graphics (shapes, transformations, clipping, masking)
• Animations
• Input: Mouse and Keyboard
• Media (WMV, WMA, MP3)
• Imaging (JPG, PNG)
• Text (static and flow)
– HTTP downloader
– XAML Parser (includes CreateFromXAML API)
– JavaScript DOM
Graphics and Animations
• 2D Graphics
– Standard shapes, masking and clipping
– Transformations: skew, rotate, scale, translate, matrix
• Animation Basics
– Animations change properties over time
– Support linear, discrete and spline animation
– Animatable property types:• Double, Color, Point
• Animations and graphics are defined using XAML
Media
• Media Features
– No OS dependencies. Everything ships inside the platform• Video: WMV V7, V8, V9, VC-1
• Audio: WMA V7, V8, V9 (standard), MP3
– Multiple options for deploying media• HTTP progressive download
• Integration with Windows Media Server
Text
• Glyphs
– Fixed text
– Full Unicode glyph rendering support
– Does not support layout (word/line breaking)
• TextBlock
– Basic layout support• Left-aligned, English based text wrapping
– Support font encryption and compression
– V1 supports 64K Unicode Basic Multi-langual Plane
– Post V1, increased language support
Remember this is a still a web app
• All apps run in the sandbox
– Conceptually similar to the HTML DOM sandbox
• Apps run just like HTML pages – just click a URL
– No elevation prompts.
– No way to get out of the sandbox
• Includes some additional functionality:
– Safe isolated storage
– Client based file upload controls
– Cross domain support in-work
So…how do I?• Tools
– Developer
• Visual Studio 2005 minimum for v1.0 development
• Firebug (HTML, CSS and JS monitoring)
• Any text editor
– Designers
• Expression Blend and Design
• XAML exporters
– Adobe Illustrator, Office (good for font subsetting), Others…
• Knowledge
– Silverlight development is similar to HTML development• Presentation format for Silverlight is XAML - XAML is XML (markup)
• Silverlight V1.0 programming language is JavaScript
Silverlight JavaScript Basics
• Silverlight XAML elements are scriptable via the browser script engine (JavaScript)
• Scriptable objects are obtained via findName
– Scriptable objects (elements) can be controlled via properties and methods
– Models JavaScript and HTML DOM interaction
– findName is equivalent to document.getElementById()
– Supports tree walking via children collection
• Position set using "Canvas.Top" and "Canvas.Left"
Size can be scaled or set via Height/Width
Downloader and CreateFromXAML
• HTTP Downloader
– V1.0 supports HTTP gets (async and sync)
– Provides download progress
– ZIP packaging
– Similar to XMLHTTP
• CreateFromXAML
– Primary way in V1.0 to dynamically create content
– Supports namescopes (for name collisions)
And now for something completely different…
• Well..not completely…
• Silverlight 1.1 – the superset
– Adds managed programming model running on client-side (aka client-side CLR, even on the Mac)
• Use C# (or VB.NET, or any managed language) to code Silverlight instead of JavaScript
• Managed stack includes a broad set of familiar .NET features:
– See next slide….
Legend
V1.1
Legend
V1.0
.NET for Silverlight
XAML
Pre
sen
tati
on
C
ore
Networking
JSON
RESTPOX
RSS
Data
LINQ XLINQ
DLR
Ruby Python
WPF
Extensible Controls
BCL
Generics Collections
Inputs
Keyboard Mouse Ink
Media
VC1 WMA MP3
Browser Host
MS AJAX Library
DOM Integration
UI Core
Images
Vector Text
Animation
DRM
Media
Controls
Layout Editing
CLR Execution Engine
Deploy
Friction-Free Installer
Auto-Updater
ApplicationServices
SOAP
The missing link(s)…
Problems Solved
• Makes prototyping applications simpler
– Use of XAML by developer and designer enhances workflow
– Common tooling brings application design closer to original concept of designer - Reduces “throw away” art work
• Rich, Interactive Graphics
– Vector, Composition, Animation
• Improved User Experience
• Sophisticated Interactions Reduce Human-Computer Impedance Mismatch
Challenges Ahead
• Learning Curve of new Tooling, Language, Syntax
• Hardware Requirements – Performance
• Limited Visual Studio Support
• Blend 2.0 in CTP
• Developer to Designer Ratio Gap
• Limited Guidance, Best Practices
• No Familiar Tools that Developers are Familiar with
Timeline
• WPF – Part of WinFX (.NET 3.0) – RTM in November 2006
• Expression Blend 1.0 Released
• Expression Blend 2.0 in CTP
• Visual Studio Orcas Q4 2007
• .NET 3.5 Q4 2007
• Silverlight 1.0 Released ~Q3 2007
• Silverlight 1.1 Beta at the same time