1 1sfsfsddfdsfsfsdfsdf
1 1sfsfsddfdsfsfsdfsdf
1 1sfsfsddfdsfsfsdfsdf
Agenda 1. 2. 3. 4. 5. 6. Introduction to WPF Features & Benefits Types of WPF Application WPF Architecture Version History of WPF First WPF Application
Introduction
Introduction to Windows Presentation Foundation The Windows Presentation Foundation is Microsofts next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher. WPF combines application UIs, 2D graphics, 3D graphics, documents and multimedia into one single framework. Its vector based rendering engine uses hardware acceleration of modern graphic cards. This makes the UI faster, scalable and resolution independent.
The following illustration gives you an overview of the main features of WPF
Benefits of WPF 1. Separation of Appear ance and Behavior WPF separates the appearance of a user interface from its behavior. The appearance is generally specified in the Extensible Application Markup Language (XAML), the behavior is implemented in a managed programming language like C# or Visual Basic. The separation of appearance and behavior brings the following benefits: Appearance and behavior are loosely coupled
Introduction
Controls in WPF are extremely customizable. You can define almost any type of controls as content of another control. Put an image into a button to create an image button .
<Button> <StackPanel Orientation="Horizontal"> <Image Source="speaker.png" Str etch="Uniform"/> <TextBlock Text="Play Sound" /> </StackPanel> </Button> 3. Highly Customizable Because of the strict separation of appearance and behavior you can easily change the look of a control. The concept of styles let you skin controls almost like CSS in HTML. Templates let you replace the entire appearance of a control. The following example shows a default WPF button and a customized button.
4.
Resolution Independence All measures in WPF are logical units - not pixels. A logical unit is a 1/96 of an inch. If you increase the resolution of your screen, the user interface stays the same size - if just gets crispier. Since WPF builds on a vector based rendering engine it's incredibly easy to build scalable user interfaces.
Introduction
.NET Framework, System.Windows, and markup and code-behind, constitute the foundation of the WPF application development experience. Additionally, WPF has comprehensive features for creating user experiences with rich content. To package this content and deliver it to users as "applica tions," WPF provides types and services that are collectively known as the application model. The application model supports the development of both standalone and browser -hosted applications. 1. Standalone Applications: For standalone applications, you can us e the Window class to create windows and dialog boxes that are accessed from menu bars and tool bars. The following figure shows a standalone application with a main window and a dialog box. 2. Browser-Hosted Applications : For browser-hosted applications, known as XAML browser applications (XBAPs), you can create pages that you can navigate between using hyperlinks. The following figure shows a page in an XBAP that is hosted in Internet Explorer 7.
3. Custom Control Libraries (non-executable assemblies containing reusable controls). WPF 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.
Deccansoft Software Services WPF Managed Layer Unmanaged Layer Core API
Introduction
Managed Layer: Managed layer of WPF is built using a number of assemblies. These assemblies build up the WPF framework, communicates with lower level unmanaged API to render its content. The few assemblies that comprise the WPF framework are : a) PresentationFramework.dll: Creates the top level elements like layout panels, controls, windows, styles etc. b) PresentationCore.dll: It holds base types such as UIElement, Visual from which all shapes and controls are derived in PresentationFramework.dll. c) WindowsBase.dll : They hold even more basic elements which are capable to be used outside the WPF environment like Dispatcher object, Dependency Objects. Unmanaged Layer (milcore.dll): The unmanaged layer of WPF is called milcore or Media Integration Library Core . It basically translates the WPF higher level objects like layout panels, buttons, animation etc. into textures that Direct3D expects. It is the main rendering engine of WPF. WindowsCodecs.dll : This is another low level API which is used for imaging support in WPF appl ications. WindowsCodecs.dll comprises of a number of codecs which encodes / decodes images into vector graphics that would be rendered into WPF screen. Direct3D: It is the low level API in which the graphics of WPF is rendered. User32: It is the primary core API which every program uses. It actually manages memory and process separation. GDI & Device Drivers: GDI and Device Drivers are specific to the operating system which is also used from the application to access low level APIs
Version History of WPF WPF 3.0. The first version of WPF was released. 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, including bug fixes and performance improvements. WPF 3.5 SP1. When the .NET Framework Service Pack 1 (SP1) was released, the designers of WPF had a chance to slip in a few new features, such as slick graphical effects and the sophisticated DataGrid control. WPF 4. The latest of release of WPF adds a number of refinements, including some valuable new features that build on the existing WPF infrastructure. Some of the most notable changes include better text
Deccansoft Software Services WPF Introduction rendering, more natural animation, and support for Windows 7 features such as multitouch and the new taskbar.