2. o Disclaimer
o Code shown during this presentation will not
always be the “best” way to program in SL3
o Purpose
o High-level overview of some SL3 features
o Simple, not-super-creative demos
o ~2-3 weeks since SL3 release at MIX ’09
o Expression Blend™ will not be covered
3. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
4. o “Silverlight Vs Flash, Begun the clone
war has.”
o Stripped down .NET Framework running on
the client
o Cross-browser support
• Firefox, IE, Chrome, Safari, etc.
o Steals from WPF’s features/programming model
5. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
6. o Visual Studio 2008 SP1 or Visual Web Developer
Express 2008 SP1
o No Multi-targeting of Silverlight Applications
o No Side-by-side installation
o No Go-Live License
o No End user runtime
SL3 Beta Tools and Expression Blend 3 Preview:
o http://silverlight.net/getstarted/silverlight3/default.aspx
o Full release in Summer 2009?
7. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
8. o SL2: Element to element binding was difficult.
• Common Business Object
• Event Handler
• DEMO: Old way of binding element to element.
o SL3: Element to Element binding syntax.
• Syntax:
{Binding Path=[Property], ElementName=[Name]}
• DEMO: New way of binding element to element.
9. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
10. o .H264
• Standard – great video quality at lower bit rates
o .AAC (Advanced Audio Coding), .MP4 support
• Youtube, Ipod, PS3, Wii, etc.
• Standard – lossy compression, designed to
trump MP3
o Adaptive Streaming
• Stream live video content directly to a SL3
application (not just pre-recorded) in VC1 or
H.264
• Dynamically switch bitrates up/down
depending on various network factors
11. o EnableGPUAcceleration property
• Does not help with true “3D” operations!
o When?
• Stretching
• Rectangular Clipping (e.g. Transformations)
• Alpha Blending (e.g. Opacity)
o How?
• “Opt-in” feature
• Plugin: EnableGPUAcceleration, EnableCacheVisualization
• Element: CacheMode=“BitmapCache”
o DEMO: Play MP4 file and EnableGPUAcceleration.
12. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
13. o Perspective 3D
• Pseudo 3D
• Takes a 2D element and can place it along a
plane/projection
• Similar to Transforms
• UI Elements still usable
15. o DEMO: Rotate a UI Element 60 degrees.
o DEMO: Nifty slider binding (Mode=TwoWay).
o DEMO: What about other controls? Project some
TextBoxes.
16. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
18. UIElement.Effect Attached Property
• Included: effect, Drop shadow
• Implemented as Pixel Shaders using HLSL 2.0
(DirectX)
• Can be compiled into byte code using a
DirectX SDK utility and consumed by SL3
• Many freely available
• Not GPU Accelerated – performance intensive
• Visual effect only!
• Modify each pixel before its rendered
DEMO: Blur Effect and Drop Shadow
19. Animation EasingFunction Attached Property
o Difficult to simulate physics with linear animations (AB)
o Physics modify movements in a non-linear way
o Gravity, Friction, Centrifugal Force, etc.
o Life-like animations tricky without using key-frames
o SL3 easing animations help us apply acceleration or inertia
20. o What’s included?
o BackEase, BounceEase, CircleEase,
CubicEase, ElasticEase, ExponentialEase,
PowerEase, QuadraticEase, QuarticEase,
QuinticEase, SineEase
o DEMO: Dribbling a basketball
o DEMO: Implementing EasingFunctionBase
21. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
22. o SL on the same PC can cross-communicate:
• on the same page
• different tabs
• different browsers!
o How does it work?
• <1 MB String based messages
• No server hit
• Cross Domain Communication!
o Uses:
• Advertising Scenarios
• Islands of SL content
23. o How do we implement it?
• System.Windows.Messaging
LocalMessageSender
LocalMessageReceiver
o DEMO: Make IE, FireFox, and Chrome talk
to each other
24. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
25. o SL2: Data Validation Surprisingly Difficult
o SL3: New Binding Attribute
• {Binding ValidatesOnExceptions=True … }
• Validates exceptions caught during binding
o DEMO: How to validate data
26. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
27. o Navigation Application Project Template
• System.Windows.Control.Frame
Method: Navigate (URI)
Allows navigation between pages/controls
Back/Next button history!
– Page Title Management
URL accessible
o DEMO: Navigation Project Template
o DEMO: Add a new item: Silverlight Page
28. o But my URLs are exposed!
• App.XAML
URIMapper/URIMapping classes
o DEMO: Hide our URLs better
29. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
30. o AKA “SLOOB” – Silverlight Out Of Browser
o Enables easy install of SL Apps on a PC/MAC
• Desktop and Start Menu links
• No additional download!
• Smooth installation, basically .XAP X-Copy
• Simple AppManifest.xml change
o DEMO: Run an SL App Outside the Browser
31. o Safe and secure
• Sandbox – Same semi-trusted restrictions as web app
• IsoStore increased from 1MB 25 MB
• Must be User-Initiated install
o Can we customize the installation process?
• Code to detach: Application.Current.Detach();
• Application Title/Description
• Installation Icons
o DEMO: Add icons and text to install process!
32. o Offline API
• How do we tell if we’re running in browser or OOB?
bool Application.Current.RunningOffline;
• What if the SL Web Application is updated?
Application.Current.ExecutionState ==
ExecutationStates.DetachedUpdatesAvailable
Auto-updates out of browser version!
– BUG: Localhost does not auto-update!
o DEMO: Offline API
33. o Network Monitoring API
• How to detect current Network Connectivity?
using System.Net.NetworkInformation;
bool NetworkInterface.GetIsNetworkAvailable();
o DEMO: Network Connectivity Check
• How to detect changes in Network Connectivity?
using System.Net.NetworkInformation;
NetworkChange.NetworkAddressChanged event
o DEMO: Network Monitoring Event
34. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
35. o SaveFileDialog control
• Must be User-Initiated - .ShowDialog()
• .OpenFile()
Just a stream to write to
Useful for allowing the user to save content
outside of IsoStore
o DataForm Control
• Binds to an entity
• Displays a UI for Entity CRUD
• Can cycle through a collection of entities
• Very configurable for look/feel (Content Template),
validation, event hooks (begin edit, cancel edit, end
edit, etc.)
36. o Bitmap API
o Render any UI Element into a Bitmap!
o Uses: Face recognition, Motion detection
o New Layout Controls
o WrapPanel, DockPanel, TreeView, Accordian
o CSS Style Enhancements
o Styles can now be changed at runtime, easier app-theming
o Based On Styles
38. o Plugin/runtime shrank in size
o XAP Compression (10-30% decrease in size)
o DEMO: Reduce XAP Size further by Caching
Framework Assemblies
o Text Improvements (ClearType)
o Isolated Storage Performance Increase
o Data-driven SEO support
o Binary XML encoding in WCF Stack
• Smaller Messages/Better Performance
o Multi-touch code present (useful for Mobile)
39. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
40. o LOB
o Printing functionality is absent
o Missing SQL Report Viewer control
o No flow document support
o Better validation control
o No Camera/Microphone support
o UDP support
o More 3D Support
41. o What is Silverlight?
o System Requirements
o Element to Element Binding
o Audio/Video Capabilities
o Perspective 3D
o Effects, Easing Animations
o Local Messaging
o Data Validation
o Navigation/Deep Linking
o Running Outside the Browser
o 60+ New Controls/other small enhancements
o Deficiencies
o Q&A
42. o Credits:
• Mike Taulty’s SL3 blog
http://mtaulty.com/CommunityServer/blogs/mike_taultys_bl
og/archive/2009/03/18/silverlight-3-more-posts.aspx
• Tim Heuer’s blog
http://timheuer.com/blog/archive/2009/03/18/silverlight-3-
whats-new-a-guide.aspx
• Joe Stegman’s MIX 09 SL3 presentation
http://videos.visitmix.com/MIX09/T14F
• Silverlight 3 GetStarted Videos
http://silverlight.net/learn/videocat.aspx?cat=12#sl3
Notes de l'éditeur
20+ years as a software developer – in many roles
Latest role is build & release master
Using VSTS since early betas
Please ask questions
Flash adoption rate vs SL adoption rate
Overloads for methods are gone to keep download size low
Syntax similar to WPF (XAML) – takes a normal ASP.NET developer a day or two to learn the base syntax