News   Articles   Sources   Code libraries    RSS

Language:

English   Russia  

Current filter:

All   C#   C++   C  



Log in:

Name
Pass

Register

Security Software for Administrator

Avalon or Windows Presentation Foundation (WPF)


Language:C#
Category:System
Date: 2008-10-24
Author:Security Software for Administrator

GDI is an old Windows graphic system based on simple functions and implement basic functionality. The GDI system uses hardware capability inefficiently. Most of time user interfaces based on GDI are tedious. There is a new Microsoft graphic system Avalon or Windows Presentation Foundation that ready to break bottleneck.

WPF or Windows Presentation Foundation is a new generation of graphic system, based on XAML and first released in Windows .NET Framework 3.0 (formally called WinFX). Despite.NET must be cross platform system, WPF may not work in non Windows system. I haven’t seen implementation of WPF for non Windows system yet.

Minimum requirement is the Windows XP SP2 system. Vista already has Avalon and you don’t have to do any additional installation. Windows XP/2003 requires additional installation of additional libraries. It is not include .NET Framework 3.0 by default.

The most famous WPF based application is Microsoft Silverlight that enables you to run Flesh like applications. You may create attractive WEB applications using Microsoft Silverlight. It is not support 3D functions, but 2D functions and vector-based drawing are included. WPF allows you to build desktop applications and Internet applications, that will be started with the help of Silverlight.

3D interface using WPF
3D interface using WPF

Windows Presentation Foundation is already here

You may use all old technologies to build user interface. I do not recommend you to rewrite your existing code with WPF. Think about the new technology more carefully. Use WPF with programs that really require the rich 2D or 3D interface only. Answer the next two questions when you start developing a new project:

  • Do you really need Windows Presentation Foundation to build the user interface?
  • What advantages you will get from using WPF?

If you would see advantages you could choose new technology or rewrite your existing code.

Microsoft invents new technologies on a regular basis. Despite the new technologies features, the company doesn't rewrite its code. Software developers still uses the old ODBC drivers in projects, where there no need to rewrite code. Look at the Ribbon panels from Office 2007. Microsoft uses panels like this in several projects. Most of applications use old style menus and toolbars.

I do not prohibit you from using WPF. You may use it and I will use too, if I see advantage from Windows Presentation Foundation for my application.

WPF interface in a business application
WPF interface in a business application
WPF in .NET stack
.NET stack and WPF

XAML

Windows Presentation Foundation bases on a new generation language – XAML (Extensible Application Markup Language). The language is based on XML. Using AXML application interface designers may create form design. It should be noted that face of a program window may create a man, who can’t program. Software designer has to know how to create interface and can make it without programming.

WPF separates development from designing. You can use special software for designers to create user interface. Meanwhile, software developer may write code. Code has to be written by developers. Design has to be created by professional designers.

To create user interface Microsoft offers to us software like Microsoft Expression Blend (http://www.microsoft.com/expression). It is a special software for designers to create sunning user interface. The program do not require development experience.

Blend is a program to build WPF interface
Blend is an excellent tool to build WPF interface

XAML example

Let’s take a deeper look at XAML. To do it we have to run Visual Studio IDE. I use latest version of Visual Studio - 2008. Start IDE and choose the File | New | Project menu item. A new project creation dialog box will be displayed. Select WPF Application as shown on the screen below:

WPF Application creation
You have to create WPF Application to use WPF

Visual Studio will create a new project that consist of *.xaml and .xaml.cs files. The *.xaml files are used to describe visual interface. The .xaml.cs files used to write code using C# language. Open Window1.xaml and investigate it. The example bellow shows us how to describe a window using XAML language:



It looks like XML. Attribute Title is a title of window. The Height and Width attributes allow to set width and height of window. To change properties of a control you can modify XAML directly or use visual designer and Properties window.

Properties window
Properties windows

WPF it is an excellent technology with big future. Will I use Windows Presentation Foundation in my applications? I think so. I don’t use it yet but I’m going to do it in the near future.


Send your comment

Your name:
Vote:
Title:
Comment:
Protection code:





Submit an article   Submit a file

Copyright © HackishCode.com 2008. All rights reserved
WEB Design and WEB Development by WEB consulting company ProfWebDev.com
www.hackishcode.com