Funding for 'IT Lab' Project, Phase 1: Progress of sticker sales. Purchase a sticker to help us reach our target.Updated: 2010-02-28 11:53
10.7%
Windows Presentation Foundation (WPF)


by Sujith Chandana


Windows Presentation Foundation (WPF) is a next generation presentation system for building windows client applications with many interesting data visualization techniques. With WPF, you can create a wide range of both standalone and browser-hosted applications attractively.

Look at following examples.

                                           

                                                            

WPF is included in the Microsoft .NET Framework, so we can build applications that incorporate other elements of the .NET Framework class library.

With the first version of the WPF, developers will be able to write applications that match the functionality and skill that is common for Win32 or DHTML applications and content. Twitch games and high-end scientific visualization/CAD applications, in general the aim of 3D graphics developers, are not surrounded by the scope for WPF in its first release.  However, even in those application domains, there are ways that WPF can be used to add UI value.

Advantages of WPF

  • Cool applications in less time.
  • Effective use of Graphics Card highly suitable for high end /upcoming computers.
  • We can create 3D scenes very easily.(Using ViewPort3D)
  • The WPF graphics system uses device-independent units to enable resolution and device independence. Each device independent pixel automatically scales with the system's dots per inch (dpi) setting. This provides WPF applications proper scaling for different dpi settings and makes the application automatically dpi-aware.
  • Data binding
  • Built in Animation
  • Templates&Styles
  • Resource management
  • Content control mechanism.
  • Extensible Application Markup Language (XAML) (Designer and developer can work independently) 
  • XAML Browser Application   (XBAP)
  • Silverlight (WPF/e)
  • Same programming model for windows&web
  • Retained mode graphics (No need to draw in the on paint event. Everything automatic)
  • Supports most of the media/document formats natively

So, latest version of the windows presentation foundation came with the .Net Framework 3.5. In the newest version, Windows Presentation Foundation contains changes and improvements in many areas, such as versioning the application model, data binding, controls, documents and 3-D UI elements. It is more compatibility with previous version of .Net Framework 3.0. That means, an application built with WPF 3.0 will run on the WPF 3.5 runtime and an application built with WPF 3.5 will execute on the 3.0 runtime if the application only uses features that are available in WPF 3.0.

Fore more details of the new features use: msdn.microsoft.com

Now look at the nice Graphical User Inter Face in windows vista. WPF is the new presentation framework for Windows Vista that also works with Windows XP. If you want to build applications that take full advantage of Windows Vista's new user interface capabilities, you need to learn Microsoft's Windows Presentation Foundation (WPF).

Getting Started with WPF

< Create new project as WPF application. Then you will appear xaml file and C# file call xaml.cs

Xaml code

<Window x:Class="WPF1.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Introduction to WPF and XAML" Height="300" Width="300"

    Visibility="Visible" WindowStyle="ThreeDBorderWindow"

    Background="AntiqueWhite" Foreground="Coral" BorderBrush="Chocolate"

    OpacityMask="Azure">

    <Window.BitmapEffect>

    <DropShadowBitmapEffect Color="DarkSeaGreen" />

    </Window.BitmapEffect>

    <Grid>

    <Button HorizontalAlignment="Right" Margin="0,120,61,118"

Name="button1" Width="69" Click="button1_Click”

Background="OrangeRed">Click</Button>

    </Grid>

</Window>

C# code

public partial class Window1 : Window

    {

    public Window1()

    {

    InitializeComponent();

    }

    private void button1_Click(object sender, RoutedEventArgs e)

    {

    MessageBox.Show("Hellow WPF");

    }

    }

You can modify application by editing xaml and adding components to form. Future articles will cover more things in WPF.

      

         Reference:

               1. msdn.microsoft.com


     2. Devasp.net

   

Share/Save
No votes yet

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options