Presentasjon lastes. Vennligst vent

Presentasjon lastes. Vennligst vent

WPF/E Introduksjon til Olav Tollefsen Utvikler- og plattformteamet Microsoft Norge.

Liknende presentasjoner


Presentasjon om: "WPF/E Introduksjon til Olav Tollefsen Utvikler- og plattformteamet Microsoft Norge."— Utskrift av presentasjonen:

1 WPF/E Introduksjon til Olav Tollefsen Utvikler- og plattformteamet Microsoft Norge

2 Introduksjon til Microsoft Silverlight Olav Tollefsen ) Utvikler- og plattformteamet Microsoft Norge

3 Microsoft Silverlight cross-browser cross-platform plug-in for delivering the next generation of media experiences & rich interactive applications (RIAs) for the Web

4 Hvorfor Silverlight? Muliggjør bedre brukeropplevelse / mer funksjonalitet for web applikasjoner Vektor grafikk, Media, Animasjon Lett å integrere med eksisterende løsninger XAML kode for å beskrive GUI JavaScript eventhåndtering / kode (.NET codebehind senere) Støtte for å kjøre på flere plattformer og browsere Liten runtime (1.1MB) som lastes ned første gang Internet Explorer, Firefox Windows, Macintosh

5 V1 Plattform støtte

6 Silverlight applikasjoner

7 Hva er forskjellen på Silverlight og Windows Presentation Foundation? Windows Presentation Foundation er Microsoft’s strategiske plattform for å bygge Windows applikasjoner Kjører kun på Windows og krever.NET 3.0 runtime installert Støtter full.NET programmeringsmodell Kan kjøres utenfor browser som en selvstendig applikasjon

8 Hva er forskjellen på Silverlight og Windows Presentation Foundation? Silverlight er laget for å nå “alle” web brukere Kjører kun i browser Støtter flere platformer Støtter et subset av WPF sine muligheter Støtter ikke en full.NET programmeringsmodell (kjører på andre plattformer)

9 Hvordan bygge en Silverlight applikasjon?

10 Template for Visual Studio 2005 Ligger under Tools katalogen i SDK

11 Template for Visual Studio 2005

12

13 Instansiering av Silverlight i browser

14 XAML (GUI)

15 JavaScript (kode)

16 Debugging av JavaScript

17 Vista: Kjør VS 2005 som Administrator

18 Opprette Silverlight prosjekt

19 Verktøy for å bygge Silverlight applikasjone

20 Designer-Developer Productivity •Microsoft Tools for Designer & Developers •Declarative Programming through XAML •Third Party Tools (e.g. Aurora by Mobiform, ZAM 3D by Electric Rain) Designers design With XAML designers & developers can streamline their collaboration Developers add business logic

21 Kode: Visual Studio 2005 (Orcas blir bedre)

22 Grafikk-elementer: Expression Design (vektorbasert, XAML)

23 HTML sider: Expression Web (JavaScript / CSS)

24 XAML GUI: Expression Blend

25 Expression Media Encoder (Beta 2)

26 Hva inneholder Silverlight som plattform?

27 Interactive Content Experiences Powerful vector graphics engine Device independent resolution scaling Flexible animation system Enable declarative animation of any element Declarative markup approach enables great tool integration and designer/dev workflow Easy AJAX scripting with JavaScript

28 Media Support Built-in Audio and Video Codec Support MP3 and WMA Audio WMV video Supports downloading media via standard HTTP requests (works with any web server) Will also support broadcast/live streaming later this spring for webcasts, events, etc. Supports 720 HD video, full screen projection, and best compression in industry

29 Drawing with XAML Basic Vocabulary of Silverlight XAML Elements CanvasBrushes Basic shapes Rectange, Ellipse, Line, Polygon, etc. TextBlockImage

30 XAML Sample For example: xmlns:x="..."> xmlns:x="...">

31 Canvas Is a Drawing Surface Children have relative positions: Width="200" Height="150" Fill=“Yellow" /> Width="200" Height="150" Fill=“Yellow" /> The Canvas The Rectangle

32 Canvas (2) Position relative to first Canvas parent: Width="200" Height="150" Fill="Black" /> Background="Red"> Fill=“White" /> Width="200" Height="150" Fill="Black" /> Background="Red"> Fill=“White" />

33 Shapes

34 Integrating Media Used to show media (music or video) Control Video with Code No Built-in Controls – You build the UI in XAML xmlns:x="..."> xmlns:x="...">

35 Naming Objects in XAML XAML objects can be named by adding a x:Name attribute to the element: They can then be referenced by other XAML elements elsewhere in the file Can then be programmed against via code Height="100" Fill="Yellow" /> Height="100" Fill="Yellow" />

36 Find XAML object via script findName(name) method on Silverlight control var wpfeControl = document.getElementById("WpfeControl1"); var theCircle = wpfeControl.findName("theCircle"); if (theCircle != null) theCircle.opacity =.5; theCircle.opacity =.5; var wpfeControl = document.getElementById("WpfeControl1"); var theCircle = wpfeControl.findName("theCircle"); if (theCircle != null) theCircle.opacity =.5; theCircle.opacity =.5; xmlns:x="..."> Height="100" Fill="Yellow" /> xmlns:x="..."> Height="100" Fill="Yellow" />

37 CreateFromXaml method Allows dynamic Silverlight object creation and insertion into existing XAML tree Enables very interesting AJAX scenarios where the XAML fragment is created and returned from a server var wpfeControl = document.getElementById("WpfeControl1"); var rootCanvas2 = wpfeControl.findName("canvas2"); var fragment =' '; var newRect = wpfeControl.createFromXaml(fragment); var newRect = wpfeControl.createFromXaml(fragment); rootCanvas2.children.add(newRect); var wpfeControl = document.getElementById("WpfeControl1"); var rootCanvas2 = wpfeControl.findName("canvas2"); var fragment =' '; var newRect = wpfeControl.createFromXaml(fragment); var newRect = wpfeControl.createFromXaml(fragment); rootCanvas2.children.add(newRect);

38 Silverlight Events Standard Events LoadedMouseMoveMouseEnterMouseLeaveMouseLeftButtonDownMouseLeftButtonUp Use.NET / ASP.NET AJAX event pattern: function onMouseEnter(sender, eventargs) { sender.Fill = “Red”; sender.Fill = “Red”;} function onMouseEnter(sender, eventargs) { sender.Fill = “Red”; sender.Fill = “Red”;}  New in Feb CTP:  KeyUp  KeyDown  GotFocus  LostFocus

39 Silverlight Event Example xmlns:x="..."> Height="100" Width="100" Fill="Teal" /> Height="100" Width="100" Fill="Teal" /> xmlns:x="..."> Height="100" Width="100" Fill="Teal" /> Height="100" Width="100" Fill="Teal" /> function onMouseEnter(sender) { sender.Fill = “Coral”; sender.Fill = “Coral”;} function onMouseLeave(sender) { sender.Fill = “Teal”; sender.Fill = “Teal”;} function onMouseEnter(sender) { sender.Fill = “Coral”; sender.Fill = “Coral”;} function onMouseLeave(sender) { sender.Fill = “Teal”; sender.Fill = “Teal”;}

40 Bygge en Silverlight Media applikasjon

41 Where To Learn More Silverlight Dev Center on MSDN Great SDK documentation and Quickstart samples Good blogs to watch:

42 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Laste ned ppt "WPF/E Introduksjon til Olav Tollefsen Utvikler- og plattformteamet Microsoft Norge."

Liknende presentasjoner


Annonser fra Google