41

* Windows Runtime Note – MSDN Documentation The namespaces are exposed using API metadata format (Windows.winmd) similar to that used

Embed Size (px)

Citation preview

Modernizing WPF Line of Business ApplicationsDmitry LyalinProduct Marketing Manager

DEV-B325

Speaker IntroductionProduct Manager for Visual Studio & TFS14+ Years of Software DevelopmentGamer, mobile & cloud developer (WP & Win8 + Azure)

Blog http://www.lyalin.comTwitter http://www.twitter.com/lyalindotcomEmail [email protected]

Agenda

Lets talk about existing technologies that can be used in Modern WPF Applications

Agenda• Putting WPF into perspective• What (was) new in .NET / WPF 4.5• Connecting to modern services such as OData, HTTP Services, SignalR• Entity Framework, Immutable Collections & Portable Class Libraries

• Enhancing touch experience using 3rd party controls• Integrating with Windows 8 Notifications• Taking advantage of the Windows 8 Touch Keyboard

WPF for WindowsDesktop Applications

Just the facts, what’s true today?

WPF is the best way to build Windows Desktop Applications when using .NET & Managed Languages (such as C# or VB.NET)

WPF in 2013• Modern & powerful platform for

building .NET Desktop Applications on Windows

• Fully supported & runs great on Windows 8• Easy to deploy within an organization

(ClickOnce, .NET 4.5 bootstrapper, etc)

.NET 4.5, including

Async

Entity Framework

5

Immutable Collections

(BCL)

Reactive Extensions

Microsoft

Platforms &

Skillsets

XAML

.NET Framework 4.5

XAML

.NET Managed API for Windows Phone

XAMLWinJS

Windows Runtime*

* Windows Runtime Note – MSDN DocumentationThe namespaces are exposed using API metadata format

(Windows.winmd) similar to that used by the .NET framework

HTMLJavaScri

pt

.NET Framework 4.5

AS

P.N

ET

Desk

top

Win

dow

s S

tore

Win

dow

s Ph

on

e

C# VB.NET

C++

C# VB.NET

C++

C# VB.NET

C++

C# VB.NET

C++

.NET 4.5

Recap – .NET & WPF 4.5 Improvements.NET 4.5• Introduction of Async &

PLINQ• Introduction of Portable

Class Library• Zip Compression• Web Bootstrapper, no

more need for Client Profile Installer

WPF 4.5• Modify Collections on non-

UI Threads• Improved support for Weak

References to events• Async Data Validation• Binding to Static Properties

Connecting Modern WPF applications to Modern Services

OData• OData is a standardized protocol for creating and consuming data APIs

• OData builds on core protocols like HTTP and commonly accepted methodologies like REST. The result is a uniform way to expose full-featured data APIs

• Built on the manipulate data sets through CRUD operations (create, read, update, and delete)

HTTP Services• Stateless & scalable services over HTTP,

including RESTful Services• Communication over standard HTTP using

a handful of verbs (GET, POST, and so forth) plus a few simple concepts such as URIs and headers

• Connect any HTTP capable client including iPhone, Android or Windows Phone apps, Windows 8 Store Apps, WPF Desktop Applications, Etc

SignalR• SignalR is an ASP.NET library designed to

help developers simply the process of adding real-time functionality to their sites or apps

• SignalR enables real-time communication between server, apps and websites using WebSockets or fallback methods

• The source code for ASP.NET SignalR is available under an open source license

Demos of Modern Services & WPF

OData (created using ASP.NET WCF Data Services)

HTTP Services (created using ASP.NET Web API)

SignalR (created using ASP.NET & Open Source Nuget Packages)

.NET Framework

Portable Class Library (PCL)• A Class Library project that enables you to

write and build managed assemblies that work on more than one .NET Framework platform

• You can create classes that contain code you wish to share across many projects, such as shared business logic, and then reference those classes from different types of projects

• Works across Windows Phone, Windows Store, Desktop .NET Applications, Xbox 360 & Silverlight

Entity Framework• Entity Framework (EF) is an object-

relational mapper that enables .NET developers to work with relational data using domain-specific objects

• Entity Framework eliminates the need for most of the data-access code which developers usually need to write using T-SQL

• EF5 is currently available for production use (EF6 beta is also now available)

Immutable Collections• Immutable Types or your money back• The above is a joke, please don’t sue me

• Available Collection Types (in preview release)• ImmutableStack<T>• ImmutableQueue<T>• ImmutableList<T>• ImmutableHashSet<T>• ImmutableSortedSet<T>• ImmutableDictionary<K, V>• ImmutableSortedDictionary<K, V>

Learn More on the BCL Blog Post:http://aka.ms/DotNetImmutableCollections

Demos – Going beyond .NET 4.5 (via nuget)

Portable Class Library(Sharing Code, now with Async & HttpClient)

Data Access using Entity Framework(Using EF6 Beta, why not right, it’s a demo what can go wrong?)

WPF Desktop Applications &Windows 8

Windows 8 Toast Notifications• Windows 8 toast notifications are sent from

an app to the user that appear as pop-up notifications in the upper right corner of the screen

• A user can select the toast (touch or click) to launch the associated app

• Toast notifications can be sent by Windows Store and Windows Desktop applications or through a web service

Windows 8 Touch Keyboard (sample preview)• Windows 8 introduces a new touch

keyboard which is invoked by the operating system when touch input is detected in a text input field

• Windows Store apps automatically support bringing up a Touch Keyboard when a text field is active for input

• WPF Desktop applications must use automation & other logic to properly work with the touch keyboard on Windows 8

WPF Applications & Touch Input• Windows 8 is the best Windows operating

system for touch input• Windows Store & Windows Phone apps are

optimized for touch input and provide the best touch experience

• Desktop Applications such as WPF can be enhanced for better touch support through custom code or 3rd party controls

WPF UX Partners

• Dozens of WPF Controls to choose from• Full support for Visual Studio 2012

& .NET 4.5• Many controls enhanced for Touch Input

on Windows 8

Demos – Enhancing WPF on Windows 8

DevExpess, Infragistics & Telerik(Sample Applications)

Windows 8 Toast Notifications(Some restrictions do apply)

Invoking the Windows 8 Touch Keyboard (This sample is a preview, working to publish later this year)

Be sure to visit our partners!DevExpress (TechExpo Booth 828)

http://www.devexpress.com/Products/NET/Controls/WPF/

Infragistics (TechExpo Booth 403)

http://www.infragistics.com/products/wpf/

Telerik (TechExpo Booth 517)

http://www.telerik.com/products/wpf/overview.aspx

WPF Best Practices

Deep Dive on MVVM Pattern!

Just Kidding…

MVVM Testing XAML Data Binding

We couldn’t cover everything today…• Building Kinect Applications using WPF• Patterns & Practices for building WPF

applications including MVVM pattern, PRISM & Etc.

• More WPF Control Partners (including ComponentOne, Xceed, Syncfusion, etc.)

• Large eco-system of open source controls, extension, frameworks, etc. (Using Nuget & beyond)

Find me later today at the Visual Studio Booth

(Thursday June 6th, 11am to 1pm)

Related SessionsDEV-B204: Positioning Microsoft Development Technologies for Custom Application DevelopmentDEV-B305: Building Apps with the Kinect for Windows SDKBOF-DEV14: The Challenges and Opportunities of Cross-Platform/Cross-Device App DevelopmentDEV-B218: Partner Solutions for Modernizing Your .NET Applications

a-I2DGe2falsea-I2DGe2false

Related Hands-on LabsDEV-H325: What's New in the Microsoft .NET Framework 4.5DEV-H302: Asynchronous Programming in the Microsoft .NET Framework 4.5DEV-H323: Using Portable Class Libraries

a-I2DGe2falsea-I2DGe2false

msdn

Resources for Developers

http://microsoft.com/msdn

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Resources for IT Professionals

http://microsoft.com/technet

Complete an evaluation on CommNet and enter to win!

Questions or Feedback?

© 2013 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.