Windows Presentation Foundation (WPF) – Hello World :)

December 14, 2006

Hello, I’m going to write a series of articles about WPF.

This only pretend to be an introduction. I’m learning WPF as you, so feedback is welcome.

First of all, if you want to start with WPF, you must install .NET Framework 3.0 RTM and the WCF & WPF Extensions for .NET Framework 3.0 (At this moment, the last release is November 2006 CTP).

Then, you have to create a new Windows Application (WPF)

 

Now we have a file Window1.xaml

Replace the code with this:

<Window x:Class=”EjemplosBlog.Window1″
    xmlns
=”http://schemas.microsoft.com
           /winfx/2006/xaml/presentation”

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

    Title
=”BlogSamples” 
    Height
=”300″ 
    Width=”300″>
    
<Grid>
      
<Button Name=”btnHelloWorld” 
              Click
=”btnHelloWorld_Click”
              Height
=”54″ 
              Margin
=”5,5,117,0″ 
              VerticalAlignment
=”Top”>
       Hello World
     
</Button>
    
</Grid>
</Window>

A quickly review:

  • btnHelloWorld is the Id/Name of the button
  • btnHelloWorld_Click is the name event Click

Also, add this code to the code behind (Window1.xaml.cs)

 void btnHelloWorld_Click(object sender, RoutedEventArgs e)
 {
     btnHelloWorld.Content 
“From Ezequiel 
                              Jadib Blog”
;
 
}

And we are ready to launch our application 🙂

I hope this is useful. Later I will post, about how we can do it the same with Triggers.

Downloads

Microsoft .NET Framework 3.0 RTM

Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF) November 2006 CTP

Resources

Introduction to Windows Presentation Foundation

XAML.NET

Samples

Windows SDK .NET Framework Samples

Advertisements

4 Responses to “Windows Presentation Foundation (WPF) – Hello World :)”


  1. oh we didn’t care,we made it very clea. Joey Hadassah.

  2. Andemann Says:

    Finally a simple tutorial without all the nonsense not needed for hello world, thank you.

  3. Uditha Madumal Says:

    Good Work.

    Really Simple.

    Regards!

    – Uditha

  4. Aurelio Says:

    Hurrah! After all I got a webpage from where I be capable of in fact obtain useful data concerning my
    study and knowledge.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: