29
Silverlight 4 accelerated fundamentals Mike Taulty Microsoft Ltd @mtaulty [email protected] http://mtaulty.com

Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

  • Upload
    ukdpe

  • View
    836

  • Download
    2

Embed Size (px)

DESCRIPTION

Session slides from MIX10 Silverlight 4 workshop.

Citation preview

Page 1: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Silverlight 4 accelerated fundamentals

Mike Taulty

Microsoft Ltd

@mtaulty

[email protected]

http://mtaulty.com

Page 2: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

talk = slides + demos

slides are meant as revision we will go quickly

we will dig in using demos we will go more slowly

Page 3: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Silverlight is a browser plug-in

Page 4: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

it runs x-browser, x-platform

Linux support is from Novell’s Moonlight project Release is at Silverlight version 2

Page 5: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

with 3 released versions

versions are back-compat, no side-by-side today you’d start on Silverlight 3 or 4

V1

Sept 2007

V2

Oct 2008

V3

July 2009

V4

in beta

Page 6: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

for browser launched, rich internet apps

Page 7: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

in a security sandbox

in browser out of browser trusted

Page 8: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

XAML markup language defines UI

.NET code handles interaction

Silverlight .NET Application

.NET applications – XAML + code

Page 9: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Specific .NET Frameworks/Runtimes

Desktop/Server

.NET Framework 3.5 Sp1

Mobile Devices

.NET Compact Framework

.NET code on a CLR & framework

Common .NET Development

.NET Languages ( C#, VB, etc )

.NET Tools ( Visual Studio, etc )

.NET Developers & Skills

Silverlight

Silverlight .NET Framework

Page 10: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

framework capabilities

layout

styling & resources data-binding

animation

Page 11: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

layout system

Grid

StackPanel

Canvas

Custom

Layout Panels

Proportional, fixed or “right” sized rows/columns

Many items in one cell Items occupying many cells

Page 12: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

layout system

Margin Padding

alignment

alig

nm

ent

content alignment

Page 13: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

layout system

Rotate Translate Scale Skew

Page 14: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

layout system

• perspective transformations for 3D effects

Page 15: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

built-in animation system

• Animation is driven by Storyboards

Storyboard BeginTime Repeat Duration ...

From To By ...

DoubleAnimation

ColorAnimation

PointAnimation

etc

BeginTime Repeat Duration ...

From To By ...

BeginTime Repeat Duration ...

From To By ...

BeginTime Repeat Duration ...

From To By ...

> animations can apply easing functions

> ~10 built-in (e.g. sine) + custom

Page 16: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

resources and styles

• Elements have a dictionary of resources identified by Key

• Can store arbitrary objects, not just UI objects

• {StaticResource} XAML directive does hierarchical lookup

• Code can access local element’s Resources dictionary resources

styles

• Styles contain setters for Properties and Values

• Styles can derive from other styles

• Styles are applied explicitly by key or implicitly

• Can be changed dynamically to theme an application

Page 17: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Button

Grid

databinding

• Elements have a DataContext • Resolution of declarative bindings is done by hierarchically

examining an element’s DataContext

Page 18: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

databinding

databinding is key in Silverlight

Page 19: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

rich graphical capabilities

Graphics

Rectangle

Polygon

Line

Polyline

Path

Geometry

Ellipse

Text

Brushes

Effects

Page 20: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

rich media capabilities

Video

• H.264

• WMV

• 1,2,3,A,VC-1

• VideoBrush

• Smooth

Streaming

• Playlists

• Markers

• DRM

• VC-1

• H.264

• On/Offline

Audio

• WMA

• 7,8,9

• MP3

• AAC

Imaging

• Image

• ImageBrush

• DeepZoom

• WriteableBitmap

Ink

Html

• WebBrowser

• HtmlBrush

Page 21: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

in-box controls

Button

CheckBox

HyperlinkButton

RadioButton

RepeatButton

ToggleButton

AutoCompleteBox

PasswordBox

RichTextArea

Label

TextBlock

ValidationSummary

Image

MediaElement

MultiScaleImage

DataGrid

DataPager

ComboBox

ListBox

TabControl

TreeView

Calendar

DatePicker

ChildWindow

DescriptionViewer

Frame

GridSplitter

NotificationWindow

ScrollViewer

Slider

ToolTip

ViewBox

WebBrowser

Page 22: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Silverlight Toolkit controls

• CodePlex project with source code

DockPanel

WrapPanel

Accordion

LayoutTransformer

TransitioningContentControl

Expander

BusyIndicator

ButtonSpinner UpDown Controls Rating TimePicker Drag/Drop GlobalCalender

Page 23: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

controls

controls are key in Silverlight

Page 24: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

Silverlight

Silverlight

apps interop with the browser

• From .NET – access the plugin settings

– access the browser info

– access the HTML Page

– access to the HTML Window

– access the HTML DOM

– access the Javascript engine

• From Javascript – access the plugin object

– access registered .NET types

– access objects in visual tree

• Silverlight Silverlight – secure x-app communication

– spans browser instances

– includes out-of-browser apps

Page 25: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

rich internet applications

firewall

Page 26: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

network

network is key in Silverlight

Page 27: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

apps interop with the machine

• read/write files – isolated storage

– via explicit open/save file dialogs

– without dialogs

• detect network status & changes

• display notification windows

• access the local clipboard

• access a webcam/microphone

• print via a print dialog

• act as a drop target for files

• call local COM code

Page 28: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

resources

www.silverlight.net

Page 29: Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.