Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Blogs | Beginners | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Team Foundation Server Hosting
Search :       Advanced Search »
Home » WPF » WPF: An Introduction (Part 2)

WPF: An Introduction (Part 2)

This is the second part of an introduction to WPF; here we are going to learn WPF in detail.

Author Rank :
Page Views : 3868
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 



Back to Part 1

ADVANTAGES & DISADVANTAGES OF WPF:

Advantages:

  • Tight multimedia integration - to use 3-D graphics, video, speech, and rich document viewing in Windows 32 or Windows Forms applications, you would need to learn several independent technologies and blend them together without much built-in support. WPF applications allow you to use all these features with a consistent programming model.
  • Resolution independence - WPF lets you shrink or enlarge elements on the screen, independent of the screen's resolution. It uses vector graphics to make your applications resolution-independent.
  • Hardware acceleration - WPF is built on top of Direct3D, which offloads work to graphics processing units (GPUs) instead of central processor units (CPUs). This provides WPF applications with the benefit of hardware acceleration, permitting smoother graphics and enhanced performance.
  • Declarative programming - WPF uses Extensible Application Markup Language (XAML) declarative programming to define the layout of application objects and to represent 3-D models, among other things. This allows graphic designers to directly contribute to the look and feel of WPF applications.
  • Rich composition and customization - WPF controls are easily customizable. You need not write any code to customize controls in very unique ways. WPF also lets you create skins for applications that have radically different looks.
  • Easy deployment - WPF provides options for deploying traditional Windows applications (using Windows Installer or Click Once). This feature is not unique to WPF, but is still an important component of the technology.
  • Culturally aware controls - static text in controls and the return data for the String function are modified according to the culture and language specified by the end user's operating system.

Disadvantages:
  • WPF's in-box control suite is far more limited than that of WinForms.
  • There's greater support in the 3rd-party control space for WinForms. (That's changing, but for now by advantage of time, WinForms has greater support in the community).
  • Most developers already know WinForms; WPF provides a new learning curve
  • WPF will not run on windows 2000 or lower.
  • No MDI child mode.

WPF TOOLS:
  1. Microsoft Visual Studio: is a developer-oriented IDE that contains a combination of XAML editor and WPF visual designer, beginning with Visual Studio 2008. The WPF designer add-in, codenamed Cider, is a WYSIWYG editor for creating WPF windows, pages and user controls. It was available earlier as Visual Studio 2005 extensions for .NET Framework 3.0 CTP for the initial release of WPF but is no longer available.
     
  2. Microsoft Visual Studio Express 2008 and later editions, particularly Visual C# Express and Visual Basic Express, also have the WPF designer integrated.
     
  3. Microsoft Expression Blend: is a designer-oriented tool that provides an art board for the creation of WPF applications with 2D and 3D graphics, text and forms content. It generates XAML that may be exported into other tools and shares solution (sln files) and project formats (csproj, vbproj) with Microsoft Visual Studio.
     
  4. Microsoft Expression Design: is a bitmap and 2D-vector graphics tool that allows export to XAML.
  5. XAMLPad: is a lightweight tool included in the .NET Framework SDK. It can create and render XAML files using a split screen UI layout. It also provides a tree view of the markup in a panel.

WPF ASSEMBLIES AND NAMESPACES:

Primary assemblies:
  • PresentationCore
  • PresentationFramework
  • WindowsBase

Namespaces
  • System.Windows

    All child namespaces except System.Windows.Forms

CLASS HIERARCHY OF WPF:

WPF2.gif

WPF ARCHITECTURE:

WPF3.gif

In this architecture these three Assemblies can be categorized as:
  • Managed Layer
  • Unmanaged Layer
  • Core API

MANAGED LAYER:

Windows Presentation Foundation (WPF) managed layer is a set of classes and types that are built using the .NET Framework which means that it is managed by Common Language Runtime (CLR). In this layer there are three assemblies that comprise the WPF framework:
  1. PresentationFramework.dll: Creates the High level elements like layout panels, controls, windows, styles etc.
     
  2. PresentationCore.dll: It holds base types such as UIElement, Visual from which all shapes and controls are derived in PresentationFramework.dll.
     
  3. WindowsBase.dll: They hold even more basic elements which are capable to be used outside the WPF environment like Dispatcher object, Dependency Objects. I will discuss each of them later.

UNMANAGED LAYER
  1. 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.
     
  2. WindowsCodecs.dll: This is another low level API which is used for imaging support in WPF applications. 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.

DIFFERENCE BETWEEN WPF AND SILVERLIGHT

Silverlight and Windows Presentation Foundation (WPF) are 2 different products from Microsoft, but have lot of overlap. Silverlight is a subset of WPF in terms of features and functionality. Silverlight was of course known as WPF/E where E means everywhere. Both use XAML, a form of XML to define controls but WPF is purely for windows while Silverlight runs in the browser on Windows and Macs. So, here are the differences between WPF and Silverlight:
  1. Silverlight is meant to be used online, while WPF is for local use.
  2. Silverlight lacks access to local resources, while WPF can utilize local resources.
  3. Silverlight only has perspective 3D support, while WPF is capable of full 3D images.
  4. Silverlight does not support some of the more advanced concepts of WPF such as controls and templating.
  5. Silverlight integrates right into an HTML page whereas WPF XAML files have to be loaded via a frame if they want to mix with HTML content.
     

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Author
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Team Foundation Server Hosting
Become a Sponsor
 Comments
Move to WPF Category by Mahesh On June 17, 2011
This article should move to WPF category.
Reply | Email | Modify 
XAMLPad by Sam On June 17, 2011
Apparently XAMLPad is no longer provided by default. Also I have found mention of XAMLPadx, which is a minor improvement. So anyone looking for XAMLPad should search MSDN for XAMLPadx.
Reply | Email | Modify 
Team Foundation Server Hosting
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.