Kevin Wonus Developer Agilex 6/21/2012
description
Transcript of Kevin Wonus Developer Agilex 6/21/2012
XAML: WPF, Silverlight, and the future of Windows
Kevin WonusDeveloperAgilex
6/21/2012
Today’s Agenda
• Background Info• Overview of technologies surrounding XAML• XAML Capabilities & Constraints• The XAML Ecosystem• WPF Demo• Silverlight Demo• Discussion• Questions
Page 2
About Me
Page 3
A Brief Bio1984-1990 Government Consulting1990-1995 Medical device industry (Cardiac monitoring)1995-2009 Commercial & Embedded Product development2009-now Government Consulting
Commercial Products• Relational Object Manager – Informix, 1995• Internet Resource Manager - Sequel Technology, 1998• Data Access Broker – Lineo, 2001• Master Network Controller – Spinoza, 2002• ProjectorNet – Spinoza (OEM product for InFocus), 2004• Shared Computer Toolkit – Microsoft, 2005• Windows Embedded Standard – Microsoft, 2007• Visualize – FiatLux Imaging, 2009
My Personal Research & Development
Page 4
My Top Sites Product(s)PotatoVision.com Lynx [open source: PHP, Flash, JavaScript]Captavate.com Reflection [XAML/WPF, C#]TrustedSound.com Baptist Church Directory [PHP, XML, XSLT]ReceivedText.com SDK for KJV bible [C++]RTBible.com KJV software for Mac [C++ & Qt Framework]AVBible.net KJV software for Windows [Delphi/Pascal, C++]
Biases
Page 5
My Biasesall code should be written with portability considerationsI prefer C++ over JavaI prefer C# over JavaI prefer App development over Web development (one reason I like XAML)
I abhor VBI prefer VB over JavaScript ;>)
Platform Portability Matrix
Page 6
OS C++ (limitations) C# (limitations) Java VB (limitations) Pascal
XP (.Net) Vista (.Net) Windows 7 (.Net) Windows 8 Desktop (.Net) Windows 8 Metro (WinRT) (WinRT) O Windows Embedded SE (.Net) Windows Embedded CE (CF) (CF) Windows Mobile (CF) (CF) Windows Phone 7 O (Silverlight) O (Silverlight) OLinux (Mono) O Mac (PowerPC) (Mono) O Mac (Intel) (Mono) O iOS (Xamarin) O Android (JNI, ADK) (Xamarin) O O
Platform Portability with C# vs. Technologies
Page 7
OS with C# support WinForms XAML WPF Silverlight MetroXP P P P P OVista P P P P OWindows 7 P P P P OWindows 8 Desktop P P P P -Windows 8 Metro (WinRT) O P O O PWindows Embedded Standard (SE) P P P P V.Next
Windows Embedded Compact (CE) P O O O OWindows Mobile P O O O OWindows Phone 7 O P O P OLinux P O O O OMac (PowerPC) P O O O OMac (Intel) P P O P OiOS O O O O OAndroid O O O O O
Platform Constraints of XAML
Page 8
OS XAML WPF Silverlight MetroXP P P P OVista P P P OWindows 7 P P P OWindows 8 Desktop P P P -Windows 8 Metro (WinRT) P O O üWindows Embedded Standard P P P V.Next
Windows Phone 7 P O P OMac (Intel) P O P O
• XAML Development constrains your development targets to almost exclusively Microsoft platforms• WPF, Silverlight, and Metro each represents a distinct dialect of XAML and distinct namespace/API• When developing XAML applications, code-reuse is limited to the Model of the MVC pattern• For maximum portability, consider XAML to be your View and separate Controller logic from Model logic• For maximum breadth, consider C# and/or C++ for your model implementation• Dot-Net interop with Java should be limited to calls to JSP services (direct Java interop is painful!)
XAML Pros & Cons
XAML Pros• One of two ways to create applications for WinRT/Metro
(the other is HTML + Javascript)• Code-behind for XAML can be any of the .Net languages
• C#• C++• VB• IronPython• IronRuby• F#• Delphi (Pascal)
Page 9
XAML Pros & Cons
XAML Cons• Not Multi-Platform: Only targets Microsoft platforms• As a newish, niche platform, limited developers• And XAML implementations still have to be ported
(each OS requires a distinct dialect of XAML)- XAML for WPF- XAML for Silverlight- XAML for Windows Phone 7 (a variant of Silverlight)- XAML for Windows Metro (XAML for WinRT)(Tags are similar, but each namespace is distinct)
Page 10
Okay, so what is XAML anyway?
XAML = XML Application Markup Language• XAML did not evolve into a UI presentation language
- Can you spell HTML?• XAML is a presentation language
- Unlike HTML: conceived & designed to craft rich on-the-metal UX
• XAML has semantics for- Vector Graphics- Precise Resolution-Independent Layout- Animations- Dynamic content- Transparency and overlay of rich text and graphics- Common UI Controls- Media Integration for Video-streaming of DRM-supported codecs Page 11
Why XAML
• Easy to Learn• Great Development Tools• Modern capabilities
• Animations• Dynamic content• Ability to craft a media-rich EPG
• Natural migration from other Microsoft technologies (ASP.Net, WinForms)
• Unless you’re a JavaScript weenie… The way to craft applications for Windows 8 Metro
Page 12
Quick look at Windows Presentation Foundation (WPF)
• Full Capabilities of .NET• Resolution-independent API• High-DPI capabilities• Hardware accelerated
• No sandboxing• Garbage-Collected Memory• Near-Native Execution• Not supported on Metro
Page 13
.NET Framework
WPF
Windows Presentation Foundation
WCF
Windows Communications Foundation
WWF
Windows Workflow Foundation
LINQ
Language Integrated Query
How is XAML different for Silverlight?
• The Silverlight namespace/API bleeds into XAML• Silverlight expands targets to Intel-based Macs• Silverlight normally runs in a browser window• Silverlight is sandboxed to reduce malicious attacks• Silverlight is a subset of WPF• Unlike WPF, Silverlight has an anemic threading model• Silverlight is the basis for WP7 applications
Page 14
How is XAML for Windows 8 Metro different?
• The XAML for Metro is yet another dialect- similar to XAML for Silverlight
• The WinRT API is supported on ARM tablets• While WinRT is sandboxed like Silverlight
- The WinRT API is more similar to .NET than Silverlight
Page 15
The ECO-System for XAML-Based Development
• First-Class development tools from Microsoft• Visual Studio• Expression-Blend• Full Intellisense (code completion … even in raw XAML)
• XAML dialects morph from target to target, but …• paradigm remains the same• Always the same tools
• Porting from one dialect of XAML to another is straightforward• Ports to multiple targets can live with a single VS Solution
Page 17
Page 18
Separation of UI from processing logic
EngineeringFunctional CapabilitiesDeployment, function, data connection and integrity, IT process,
security
DesignUser ExperienceLook, behavior, data visualization, usability, brand impact
Facilitates collaborative development• Across disciplines
• Across teams
• Across security boundaries
Tools support for WPF, Silverlight, & Metro
Page 19
Tool WPF Silverlight MetroVisual Studio 2008
3.0 3.0 OExpression Blend 3
Visual Studio 20104.0 4.0 O
Expression Blend 4
Visual Studio 20124.5 5.0 ü
Expression Blend 5
Microsoft Expression Blend to optimize UX
Page 20
Development Capabilities
Jumpstart your XAML development by leveraging Microsoft Expression Blend to craft XAML and
immediately discover the capabilities of the platform even before writing a single line of procedural
code..
Rich UX
Exceed user expectations with an immersive UI that leverages the full capabilities of the Windows
platform: built-in hardware-accelerated graphics results in the delivery of high fidelity information
for the optimum usability.
End-User Satisfaction
Drive end user satisfaction and customer loyalty with differentiated applications that are
responsive , reliable, and cool!
Demos
References:http://www.ebyte.it/library/docs/math05a/EllipsePerimeterApprox05.html
http://iltc.wordpress.com/2008/10/08/wpf-elliptical-layout-control/
http://www.sharpgis.net/post/2011/09/15/WinRT-vs-Silverlight-Part-1-XML-Namespace.aspx
Sources & Presentation at:http://TrustedSound.com/code
Page 21
Summary
The future of Windows (aka WinRT / Win8 Metro) is:1. XAML with C#, C++, VB, et al … <or>2. HTML with JavaScript3. Either of these will target Windows 8 Tablets (Intel & ARM)
Microsoft’s story here is inclusion for:• JavaScript developers with HTML5• Traditional (C#/C++/VB) developers with XAML
Microsoft’s story here is exclusive of:• Portability to other platforms (not even directly to WP7)• Java Developers• Adobe Flash Developers
Long term platform-portable soutions would be better served by alternate technologies:• jQuery taking to any back-end via AJAX/JSON/SOAP/WCF• Even ASP.Net
Page 22
Discussion
Out of the “Horse’s Mouth” -- 25 May 2009The incompatibility of XAML namespaces and available controls between Silverlight and WPF is a well-known problem. MSDN has some pretty detailed documentation on this issue. The Silverlight team has made some great efforts to improve on this in the Silverlight 3 Beta by introducing some new features that increase its compatibility with WPF. Nevertheless, there are still plenty of areas where platform inconsistencies stand in the way of having shared XAML markup and code between Silverlight and WPF.
http://blogs.msdn.com/b/daviwil/archive/2009/05/25/a-custom-preprocessor-for-sharing-xaml-between-silverlight-and-wpf.aspx
Page 23
Questions
Page 24
XAML: WPF, Silverlight, and the future of Windows
Kevin WonusDeveloperAgilex
6/21/2012