WPF – Windows Presentation Foundation what is it, what can you do with it and how do you get started.

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

The Microsoft Technical Roadshow 2006 Windows Presentation Foundation (WPF) Marcus Perryman
WPF vs Silverlight Stuart Haas. WPF  Windows Presentation Foundation  Included in Vista, Server 2008 and XP service pack 2  Deployed in desktop and.
Dinko Jakovljević Microsoft Student Partner | BambooLab
Dependency in action A look at how dependency is used in modern programming languages Antony Harfield 22 nd October 2009.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
.NET Framework Overview Pingping Ma Nov 16 th, 2006.
Michael Koester Designer Marketing Manager The World of Expression.
Windows Presetation Foundation (WPF) 1. Introduction.
Gustavo Cavalcanti tinyfit.com. About me... Programmer since mid-90s BS in Computer Science (Catholic University of Pernambuco, Brazil) MBA with emphasis.
Windows Presentation Foundation (WPF) and Dyalog APL A new era Dan Baronet and Michael Hughes Boston 2011 V1.00 0Dyalog’11 - BostonWPF and APL.
WPF. Origins – Who, When, Where  Who? Microsoft  When? November 2006  Where? Windows Vista Windows Server 2003 Windows XP Service Pack 2.
Introduction & Welcome Marcus Perryman Mike Taulty
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
WPF For PowerBuilder Developers
2 A First Look at Windows Presentation Foundation Everywhere ("WPF/E") Joe Stegman Lead Program Manager Microsoft Corporation.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to Silverlight. Slide 2 What is Silverlight? It’s part of a Microsoft Web platform called Rich Internet Applications (RIA) There is a service.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Microsoft Visual Basic 2005: Reloaded Second Edition
1 COS240 O-O Languages AUBG, COS dept Lecture 33 Building Apps Technologies C# (WPF part 1)
Next Generation for Desktop Applications Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
A Jumpstart to WPF by Kevin Grossnicklaus ArchitectNow.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
Windows Presentation Foundation. Goal The goal of Windows Presentation Foundation (WPF) is to provide these advances for Windows. Included in version.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Silverlight Hitesh Trivedi Computer Science B.Tech A-Sec J.I.E.T.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Windows Presentation Foundation Adam Calderon Principal Engineer Interknowlogy LLC
Silverlight Technology. Table of Contents 1.What is Silverlight Technology? 2.Silverlight Overview. 2.1 How it works 2.2 Silverlight development tools.
Windows Presentation Foundation (WPF) Declare Your Next User Interface.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
The Microsoft Technical Roadshow 2007 Rich Client Development in XAML Mark Johnston Developer & Platform Group Microsoft Ltd
Presentation advances in.NET Framework 3.0 Mark Johnston Developer & Platform Group, Microsoft Ltd
New Features Overview. Agenda Silverlight - Intro Silverlight 3 New Features Overview with Demos, Demos and Demos… RIA Services Overview Demos, Demos,
A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software? It’s Difficult! Animation 2D 3D Documents Styled Controls Video Windows.
Building Excellent Internet & Intranet Solutions Dave Remmer Architect Advisor Microsoft Canada
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
Contents : What is Silverlight? Silverlight Overview Silverlight Toolkit Overview Timeline & Packaging Silverlight V1.0 & V1.1 Properties of V1.0 Properties.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Ronnie Saurenmann Principal Architect Microsoft Switzerland Silverlight 5 Advanced.
1 Catching up on Rich Clients (round 1) Mike Ormond, Mike Taulty Developer & Platform Group Microsoft Ltd
1 Välkommen till Sommarkollo Windows Presentation Foundation Per Östman ISV Developer Evangelist
Silverlight 101 Ahead! If you know Silverlight and are looking for more advanced content check out : ‘Microsoft Silverlight “Media” : Moving at 60fps’
.NET Framework 3.0 Windows Presentation Foundation Windows Communication Foundation Windows Workflow Foundation.
An Introduction to Developing Applications for Microsoft Silverlight Jaime Rodriguez
Windows Presentation Foundation. User Experience: Recent Past Web HTML Sacrificed UX for portability, connectivity and simplicity 1997 – DHTML.
Web Design Principles 5 th Edition Chapter 3 Writing HTML for the Modern Web.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Introduction to Avalon Mike Taulty Microsoft Ltd
Why Windows Presentation Foundation? Windows Presentation Foundation Unified approach to UI, Documents, and Media Integration as part of development.
Introducing the Microsoft® .NET Framework
Dive Into® Visual Basic 2010 Express
Introduction to Silverlight
WPF vs Silverlight.
Introduction to Silverlight
XAML User Interface Creation in C#
Understand Windows Forms Applications and Console-based Applications
Introduction to Silverlight
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Silverlight Technology
Web Development Using ASP .NET
Desktop Window Manager
Windows Presentation Foundation
Brown Bag Seminar Summer 2007
Presentation transcript:

WPF – Windows Presentation Foundation what is it, what can you do with it and how do you get started

Windows Presentation Foundation  Deliver Innovative User Interfaces  Increase Developer-Designer Productivity;  Leveraging Existing Code Base and Skills Set “Application = Code + Markup” A productive, unified approach to UI, media and documents to deliver unmatched UX

Why WPF? For example, if you want to create a stylish glow button you need to create a custom control and paint every aspect of the button (in all its different states) using a lower-level drawing model. We can’t think about Animation …..! think about introducing animated effects such as spinning text, shimmering buttons, shrinking windows, or live previews because you’ll have to paint every detail by hand.

The Windows Presentation Foundation (WPF) changes all this by introducing a new model with entirely different plumbing. Although WPF includes the standard controls you’re familiar with, it draws every text, border, and background fill itself. As a result, WPF can provide much more powerful features that let you alter the way any piece of screen content is Rendered. you can use transformation objects to rotate, stretch, scale, and skew anything in your user interface WPF is a powerful new infrastructure based on DirectX

Overall, WPF combines the best of the old world of Windows development with new innovations for building modern, graphically rich user interfaces. Although Windows Forms applications will continue to live on for years, developers embarking on new Windows development projects should consider WPF.

What is there in WPF?  In WPF, the underlying graphics technology isn’t GDI/GDI+.  Instead, it’s DirectX. Remarkably, WPF applications use DirectX no matter what type of user interface you create. That means that whether you’re designing complex three- dimensional graphics or just drawing buttons and plain text, all the drawing work travels through the DirectX pipeline.  One component that’s still in the picture (to a limited extent) is User32. Because WPF still relies on User32 for certain services, such as handling and routing input and sorting out which application owns which portion of screen. However, all the drawing is funnelled through DirectX.

WPF TIERS Video cards differ significantly. When WPF assesses a video card, it considers a number of factors, including the amount of RAM on the video card, support for pixel shaders and support for vertex shaders. Based on these details, it assigns a rendering tier value. WPF recognizes three rendering tiers. They are as follows: Rendering Tier 0. The video card will not provide any hardware acceleration. This corresponds to a DirectX version level of less than 7.0. Rendering Tier 1. The video card can provide partial hardware acceleration. This corresponds to a DirectX version level greater than 7.0 but less than 9.0. Rendering Tier 2. All features that can be hardware accelerated will be. This corresponds to a DirectX version level greater than or equal to 9.0.

WPF – Higher Level API A web-like layout model A rich drawing model. Support for audio and video media. Animation as a first-class programming concept Styles and templates Commands Declarative user interface. Page-based applications Resolution Independence

Evolution of WPF Although WPF is a relatively new technology, it already exists in two versions: WPF 3.0. The first version of WPF was released with two other new technologies: Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF). Together, these three technologies were called the.NET Framework 3.0 (even though the core bits of.NET weren’t changed). WPF 3.5. A year later, a new version of WPF was released as part of the.NET Framework 3.5. The new features in WPF are mostly minor refinements. Some of these bug fixes and performance improvements are available to.NET Framework 3.0 applications through the.NET Framework 3.0 Service Pack 1.

New Features in 3.5 Firefox support for XBAPs Data binding support for LINQ Support for placing interactive controls (such as buttons) inside a RichTextBox control Support for placing 2-D elements on 3-D surfaces An add-in model. The add-in model allows an application to host third-party components in a limited security context.

Architecture WPF uses a multilayered architecture. At the top, your application interacts with a high-level set of services that are completely written in managed C# code. The actual work of translating.NET objects into Direct3D textures and triangles happens behind the scenes, using a lower level unmanaged component called milcore.dll.

PresentationCore.dll Applications Controls Styling LayoutDataContentAction Presentation Framework MilCore.dll DirectX Driver

PresentationFramework.dll holds the top-level WPF types, including those that represent windows, panels, and other types of controls. It also implements higher-level programming abstractions such as styles. Most of the classes you’ll use directly come from this assembly. PresentationCore.dll holds base types, such as UIElement and Visual, from which all shapes and controls derive. If you don’t need the full window and control abstraction layer, you can drop down to this level and still take advantage of WPF’s rendering engine. WindowsBase.dll holds even more basic ingredients that have the potential to be reused outside of WPF, such as DispatcherObject and DependencyObject, which introduces the plumbing for dependency properties milcore.dll is the core of the WPF rendering system and the foundation of the Media Integration Layer (MIL). Its composition engine translates visual elements into the triangle and textures that Direct3D expects.

What type of Applications can be built WPF intended to replace both webforms and windows forms – apps can be built to run in a browser or a standalone window Windows forms and WPF pages/windows can co- exist in the same application One WPF page/window can have both types of controls on it A new type of web application called XAML Browser Application XBAP (formerly Web Browser Application WBA)

XAML  short for Extensible Application Markup Language, and pronounced “zammel” is a markup language used to instantiate.NET objects  If you’re a graphic designer, that tool is likely to be a graphical design and drawing program such as Microsoft Expression Blend.  Ability to integrate the workflow between developers and designers is one of the key reasons that Microsoft created XAML.  When designing a WPF application in Visual Studio, the window you’re designing isn’t translated into code. Instead, it’s serialized into a set of XAML tags. When you run the application, these tags are used to generate the objects that compose the user interface.

Every element in a XAML document maps to an instance of a.NET class. The name of the element matches the name of the class exactly. For example, the element instructs WPF to create a Button object. As with any XML document, you can nest one element inside another. As you’ll see, XAML gives every class the flexibility to decide how it handles this situation. You can set the properties of each class through attributes. However, in some situations an attribute isn’t powerful enough to handle the job. In these cases, you’ll use nested tags with a special syntax.

XAML Namespaces The XAML parser also needs to know the.NET namespace where this class is located. For example, the Window class could exist in several places—it might refer to the System.Windows.Window class, or it could refer to a Window class in a third-party component, or one you’ve defined in your application. xmlns= entationhttp://schemas.microsoft.com/winfx/2006/xaml/pres entation xmlns:x="

XAML = Extensive Application Markup Language Button b1 = new Button(); b1.Content = "OK"; b1.Background = new SolidColorBrush(Colors.LightBlue); b1.Width = 100; C# Dim b1 As New Button b1.Content = "OK" b1.Background = New _ SolidColorBrush(Colors.LightBlue) b1.Width = 100 VB.NET OK LightBlue XAML Easily tool able, declarative markup Code and content are separate Can be rendered in the browser / standalone application

XAML: Unified Programming Model Programming and markup do not currently coexist very well together –Code is great for logic, but can be clunky for the job of laying out text and UIs –Markup is great for defining text and images, but is clunky when dealing with logic and user interaction WPF meshes the two technologies Unified approach to combining markup and code –Most apps written to WPF will be a mix of XAML and code

Markup language for declaratively designing and creating application UIs XAML maps XML markup to objects in the.NET Framework –Every tag maps to a class and every attribute to a property –But really independent of WPF Markup and procedural code are peers in functionality and performance –code and markup are both first class citizens –consistent model between UI, documents, and media

Coding in XAML XAML Okay C# Button b1 = new Button(); b1.Content = "Okay"; b1.Background = new SolidColorBrush(Colors.LightBlue); b1.Width = 100; XAML allows one root tag, generally an output surface

Coding with WPF and XAML Integrating markup and code XAML File Click Me! C# code-behind file using… namespace Button { public partial class Default : Panel { // Event handler void Button_Click (object sender, System.Windows.Controls.ClickEventArgs e) { btn1.Background = System.Windows.Media.Brushes.Red; } } Integrating markup and code XAML File Click Me! C# code-behind file using… namespace Button { public partial class Default : Panel { // Event handler void Button_Click (object sender, System.Windows.Controls.ClickEventArgs e) { btn1.Background = System.Windows.Media.Brushes.Red; } }

Application Object  Application object acts as container for more complex applications  MainWindow  Application events like  Startup & Shutdown

Content Model  WPF offers strong separation of behaviour (API) and presentation  Behaviour (API) consists of  Commands, Properties, Events & Methods  Presentation of controls is controlled by  Nested content  Templates

 WPF Content Models:  In WPF, different classes of elements are categorized based on the type and number of their logical children.  These logical children are also referred as the "content" of the control. WPF defines several different "content models" for various different classes of elements.  The controls that can contain a single item (single logical child of type Object) are called "content controls". These controls derive from the Content Control base class.  Controls that can contain a collection of items (many logical children of type Object) are called "items controls". These controls derive from the Items Control base class. There are different kinds of content models available in WPF like Controls content model, Decoder content model, Panel content model, TextBox and TextBlock content model.