SLUGUK BUILD Round-up

Preview:

DESCRIPTION

Presentation to the Silverlight User Group in London on October 12th to provide a round-up of the recent BUILD conference in LA and an introduction to Windows 8 and the Windows Runtime.

Citation preview

build

Is Silverlight Dead or Not?

/// /round-up

Who am I?»Derek Lakin @dereklakin» Senior User Experience Developer

@ Pixel Lab http://thinkpixellab.com

Agent 008 Ball

RunKeeperEvernote

SketchFlow for Windows Phone

Agenda» DEMO: Windows 8» Keynote highlights» Windows Runtime overview» DEMO: Converting Silverlight to WinRT» Silverlight and .NET on Windows 8» Summary» Q & A

Demo

Windows 8

Summary

Windows 8

» Metro style Start screen» Fast and fluid» Integrated web of applications» Sharing» Pickers» Search

» Touch-first

The good, the bad, and the funnyKeynote highlights

Windows 8 Experience

» Fast and fluid user experienceResponsive, alive and beautiful with animations and Metro style

» Immersive and full-screenFocuses attention on your apps

» Touch-first with full keyboard and mouseEnables your choice of interaction

» Web of apps working togetherApps are connected to each other and the cloud

» Experience for all PC devices & architecturesNo compromise across new factors, desktops and laptops

Developer Platform & Tools

» New APIs and tools to build Metro appsDelivers a modern platform, great tools, accelerated graphics

» Rapid and scalable development of Metro appsIncludes powerful touch-enabled controls, layouts, and templates

» Choice of world-class dev tools & languagesSupports coding in JavaScript, C#, VB, C++, HTML/CSS, XAML for x86/x64/ARM

» Business opportunity is the world of Windows 8 customersIntroduces the Windows Store

Hardware Platform» Smaller and faster on widest range of

hardware» Native SoC implementation across

x86/x64/ARM» Integrated support for broad range of

new mobile peripherals

Cloud Services» New Metro style apps for Mail, Photos,

Calendar, PeopleConnects to Live and the other services you use

» Sync across your PC devices and phoneEnables clean start on new device and roaming between devices

» SkyDrive for the information you create and care aboutStores and shares your photos, documents, and files to the cloud

» Live APIs for SkyDriveBuild your own cloud connected Metro style apps

Path to RTM» Windows 8 Developer Preview

Including VS 11 Express, Blend 5, SDK, AppsDeveloper Pre-Release

» Next milestone is Beta. Then RC, RTM, GADriven by quality, not date

» Updates along the way» Learning more

» blogs.msdn.com/B8» connect.microsoft.com» dev.windows.com» Feedback tool

What is it? What’s the difference?Windows Runtime

Summary» The Windows Runtime is the solid,

efficient foundation for the new Windows 8 developer platform» Build Metro style apps easily with the

Windows Runtime» Windows available in your choice of

language and environment» One Windows API, Natural and Familiar

Everywhere

» Don’t need to understand how it works

but …

Metro Style Application APIs

DevicesSensors

Geolocation

Portable

NFC

Communications & DataContracts

XML

Web

SMSNetworking

Notifications

Local & Cloud Storage

Streams

Background Transfer

User InterfaceHTML5/CSS XAML DirectX Controls

InputAccessibilit

yPrinting

Data Binding

TilesSVG

FundamentalsApplication

ServicesAuthenticatio

nCryptography

Globalization

Memory Management

Threading/Timers

MediaVisual Effects

Playback

PlayTo

Capture

Windows 8

Windows Kernel Services

JavaScript(Chakra)

C/C++ C#, VB

Metro style Apps

Communication

& Data

Application Model

Devices & Printing

Windows Runtime APIs

Graphics & Media

XAMLHTML /

CSS

HTMLJavaScrip

t

CC++

C#VB

Desktop Apps

Win32

.NETSL

IESyst

em

Serv

ices

Vie w

Mod

el

Con

trolle

r

Kern

el

Windows Runtime Architecture

Windows Core

Runtime Broker

Web Host (HTML, CSS,

JavaScript))

Language Support

(CLR, WinJS, CRT)

Windows Runtime Core

XAML Storage …Network

UI Pickers MediaControls

Windows Metadat

a & Namespa

ce

Language Projection

Metro style app

Windows Metadata» Concise, complete description of the

Windows Runtime» Generated natively from C++ or

C#/VB compiler» Efficient binary format» Rich enough to allow multi-language

projection generation» Full IntelliSense on statically known

information

Basic TypesExample Description

Strings HSTRING Avoids copying in multiple languages

Basic Types INT32, UINT64 * Pointers allowed in limited cases

Enumerations enum AsyncStatus

Flag or non-flag styles

Structures struct Rect; Can contain strings, but not interfaces

Simple Arrays INT32 [] For very basic collections

Interfaces Inspectable Methods are defined in interfaces

Generic Interfaces

IVector<T> Type-generic interface

Runtime class Windows.Storage.StorageFile

Binds interfaces to make a class

Common PatternsExample Description

Collections IVector<T>, IVectorView<T>, IMap<T>

Iterators, collections and events cross-language

Delegates delegate AsyncActionCompletedHandler

Encapsulate the context to call back to an object

Events IApplicationLayout::LayoutChanged

Lists of callback recipients

PropertySet Interface IPropertySet Collection of items with varying types

Async Interface

ReceivePropertiesOperation A way to get a delayed result without blocking

Contracts Windows.ApplicationMode.DataTransferManager

Connect apps to Windows extension points

Asynchronous Objects

» Basic requirement for Metro style apps» Always responsive, ready» “Long running” APIs must be delivered as async

» Simpler to allow apps to make synchronous calls» But then bad apps can overwhelm quality of

system

» Instead, build async into API shape» And have language projections integrate it deeply

» Example coming up in the demo

Is That It?» No, there’s much more» Language Projections» Runtime Object brokering» Threading» Versioning

» Check out the detailed sessions for more information if you need it

Demo

Converting Silverlight to WinRT

Summary

Converting Silverlight to WinRT

» No Blend support for XAML … yet!» No behaviors; use attached

properties» No designer-supported font

embedding» No RichTextBox; use RichTextBlock» No pixel shaders (Effect property)» No NavigateUri on HyperlinkButton

Where do Silverlight and .NET fit into Windows 8?Silverlight & .NET

.NET Lives!Windows Phone

Silverlight 5

.NET Framework 4.5

.NET Profile for Metro style apps

The .NET Perspectiveusing Windows.Storage;using System;using System.IO;using System.Threading.Tasks; class Sample { static async Task WriteAsync(

StorageFolder wrtfolder, string filename, string text) {  var wrtFile = await wrtFolder.CreateFileAsync(filename);

var wrtStream = await wrtFile.OpenAsync(FileAccessMode.ReadWrite);

using (Stream stream = wrtStream.OpenWrite()) {

using (var writer = new StreamWriter(stream)) { writer.WriteLine(text); } } }}

Native namespace

Native type

Native method

C# feature

Managed argument passed

to native APIManaged type returned from a

seemingly native method

Removed, Replaced, Changed» System.Web» System.Data» System.Runtime.Remoting» Private reflection» Application Domains

Removed, Replaced, ChangedCurrent Windows Runtime

System.Windows Windows.UI.Xaml

System.Security.IsolatedStorage

Windows.Storage.ApplicationData

System.Resources Windows.ApplicationModel.Resources

System.Net.Sockets Windows.Networking.Sockets

System.Net.WebClient Windows.Networking.BackgroundTransferandSystem.Net.HttpClient

Removed, Replaced, ChangedCurrent Windows Runtime

Serialization Use Data Contract for general serialization Use XML serialization for fine control

Reflection System.Type now represents a type reference System.Reflection.TypeInfo is the new

System.Type

XML XML Linq is the main XML parser Use XmlReader/Writer as a low-level abstraction

Collections Non-generic collections are gone New collection abstractions added:

IReadOnlyList<T>

Threading Sychronization primitives mainly unchanged Thread control in Windows.Foundation.Threading Task.Run is the new high level way of doing

background processing

Async Async everywhere

Anything Else?

» xmlnsxmlns:local="clr-namespace:<namespace>;assembly=MyAssembly>"

» DispatcherDispatcher.BeginInvoke( (s, a) => { … });

» Async// Lots of convoluted code

» xmlnsxmlns:local="using:<namespace>;"

» DispatcherDispatcher.Invoke( CoreDispatcherPriority.Normal, (s, a) => { … }, this, null);

» Asyncvar x = await foo.DoAsync();

So, is Silverlight dead or not?

Summary

Predictions» Windows 8 will have multiple SKUs

with and without the Desktop and Metro shell

» The next major update to Windows Phone will move to Windows Runtime

» HTML5 + JavaScript is the next “big thing”

» There won’t be another major update to Silverlight (beyond v5) or WPF

» But … XAML isn’t going anywhereDisclaimer: These are my personal thoughts and opinions and are not based on any insider information, neither do they necessarily reflect the opinions of anyone else, let alone my employer.

Resources» Metro from the Trenches

http://metrotrenches.wordpress.com» Windows Dev Center

http://dev.windows.com» Windows Dev Forums

http://forums.dev.windows.com

Parting Thoughts» “this is the most excited I've been

about Microsoft for 5 years” - Robby Ingebretsen

» “Microsoft is really investing in user experience” - Laurent Bugnion

» “The new Windows 8 Start screen isn’t just a good idea, it’s a great interface that will make sense on phones, tablets, PCs of all stripes, and even servers. And before you know it, you’ll forget all about that old-fashioned Start menu.” – Paul Thurrott

Q & A

What do you want to know?