Tuesday, January 8, 2013

What Is WPF?

Windows Presentation Foundation (WPF) could be termed the next generation of Windows user

Interfaces. It could be, but there are too many companies that will be wedded to Windows Forms for

Many years to come. It may be more accurate to call WPF an alternative to Windows Forms. Although

the two technologies differ in many ways, they both aim to achieve the same end: providing a user

interface on the Windows desktop for applications written using the .NET Framework.


Figure above shows the general architecture of WPF and its constituent parts.

The three subsystems that are the newly added ingredients that form WPF are

1) Presentation Framework:

Presentation Framework is the subsystem that contains the entire user interface

components. It has a rich library of controls that can be used by WPF

applications. You can think of your WPF application as sitting on top of all of

this architecture, leveraging the functionality of the .NET Framework and WPF

to produce something usable and, ideally, profitable.

2) Presentation Core: Presentation Core contains all of the classes and interfaces that form the groundwork for WPF. It does not contain any user interface controls—it is more

like the foundations that the controls are built on.

3) MIL Core: MIL Core is unmanaged, which enables it to wrap DirectX much more closely.

MIL Core stands for Media Integration Layer. It is an unmanaged wrapper

around DirectX and allows the Common Language Runtime (CLR) to interface with DirectX.

4) Kernel: The Kernel provides low-level operating system services such as primitive input and output (I/O), memory management, and process/thread creation and synchronization functions.


5) User32:User32 provides applications with the means to create graphical user interfaces (GUIs) by using the message queue, creating and managing windows, and so forth.

6) DirectX provides an Application Programming Interface (API) for creating 3D graphics, either using software rendering or via 3D graphics accelerator cards.

7) CLR: The Common Language Runtime (CLR) is Microsoft’s implementation of the Common Language

Infrastructure (CLI) standard: C# and Visual Basic .NET code are actually compiled into Common

Intermediate Language (CIL) bytecode, which is compiled again by the CLR at runtime before being

executed. All .NET languages operate this way and sit on top of the CLR.

WPF & WINDOW FORM Comparison
 1)WPF applications are graphically superior to Windows Forms applications; WPF user interfaces often look more compelling than their Windows Forms counterparts.
2)WPF applications have a higher minimum hardware—and, in fact, software—requirement than Windows Forms applications.
3) Graphically superior means that 3D is supported; cutting-edge graphical rendering techniques can be employed and any hardware acceleration present in the machine that is running the application will be leveraged.
4) WPF applications will run only on a minimum of Windows XP Service Pack 2
5) Windows Forms is used to target operating systems such as Windows 98 or 2000
6) WPF is built on DirectX unlike Window form which used GDI+.

What Is GDI?

The Graphics Device Interface (GDI) API is contained within the GDI32.dll that ships with the Windows operating system, and has been deprecated since Windows XP.

   It provides facilities for low-level drawing of lines and curves, font rendering, and other menial graphical tasks that are expanded upon in other APIs, such as User32.

    Since Windows XP,GDI has been superseded by GDI+, which is a C++ implementation of a similar primitive graphics layer but adds support for extra features such as gradient shading and for JPEG and PNG graphics files.

    Much of the System.Drawing namespace and its container, the System.Drawing.dll assembly, is a managed code wrapper around GDI+.

What is DirectX?

DirectX is an API built for graphically intensive applications such as Computer Aided Design (CAD)

Applications or video games. It provides an interface for rendering graphical scenes represented in three dimensions onto a two-dimensional projection, such as computer monitor.

 As managed .NET code can’t use unmanaged APIs directly, WPF uses a wrapper around DirectX as an intermediary.

MIL Core provides a low-level interface to the DirectX API, and WPF builds on top of this to perform all of its graphical rendering.

How To Target both WPF & Silverlight:

1) Separate Assembly for both
2) Partial Classes(introduced in .Net 2.0)
3)Extension Method(introduced in .Net 3.0)
4) Compiler Directives

What is XAML?

  Extensible Application Markup Language, or XAML (pronounced "zammel"), is an XML-based markup language developed by Microsoft. XAML is the language behind the visual presentation of an application.

     To solve a particular problem Object-oriented paradigm combine data with methods that

Operate on the it. Windows Forms makes use of this paradigm, building the user interface on top of object-oriented code. Whenever you use the Windows Forms designer, the underlying functionality is still provided by

Object-oriented code that instantiates control classes and sets their properties to reflect your design.

   XAML uses a declarative programming paradigm, which allows developers to lay out their user interface without any references to control flow this means
1) XAML is more intuitive than Windows Forms code, because it is specialized for the purpose

of describing a user interface.
2) It separates the user interface declaration from its code counterpart.

XAML, the XML-based markup language that allows developers to create user interfaces declaratively, rather than programmatically.

No comments:

Post a Comment