?

Log in

Yes, this is still a listbox

One of the coolest things in WPF is still editing styles and templates of different controls. 

Most people have no problems to edit the template of a button, textblock,... but the problems start when they edit a more "complex" control like a listbox.

In this tutorial I edit the template of a listbox and his listboxitems.  It builds further on the tutorial of the ObservableCollection and I reuse some code of this tutorial.  This time it is written in C#.

You can download the tutorial and the entire source code:

Silverlight invaders

I just finished my first Silverlight project.  It is a simple game, just a little bit like space invaders.  We got a good guy and a lot of bad guy who has to be shot.

The tutorial is especially about creating usercontrols with Expression Blend, creating storyboards and call these storyboards from code behind.  The best way to make this tutorial in my option is to open the completed project, and copy/paste some of the c# code.

The pdf is pretty detailed in the beginning,but the last steps are described more vague because the same steps always remain.

The credits for this tutorial also goes to my colleague who helped a lot with this project.

You can download the tutorial and the entire source code:

A couple of days ago, I was working on program that can process the results of students.  I wanted to create a listboxitem for every student that contains a textblock for the name and a textbox to insert or update the result.

After asking advise on different forums and a lot of trying and failing, I finally found a way to get this done.

I use a ObservableCollection for data binding to my listbox.  Use a datatemplate to put different controls in the itemtemplate, and a value converter to indicate if the student is passed or not.

My conclusion: an ObservableCollection is very powerful!

You can download the tutorial and the entire source code:

Binding to a method

In this tutorial, I've wrote a simple class with one function called Sum.  The function demands two numbers and returns the sum of the two numbers.  On my form I have two textboxes to insert the numbers, and one textbox that shows the result.  Nothing really special, isn't it?

Well, I use databinding in XAML to call and execute the function Sum.  So, I don't need any code behind ( except the code for the function ).  This is a simple example, but the same technique can be used to fill a combobox or listbox with an array, collection, hashtable,...

You can download the tutorial and the entire source code:

Create a Vista-style login button

In this tutorial I created a button that contains the picture of a certain user and has the name of the user below.  You can compare it with the login screen of Windows Vista.

The purpose of the tutorial is to break the template of a control and rebuild it just the way you want.

The only tool I use in this tutorial is Expression Blend.  You can download a PDF document that describes the different steps or you can also download the video that shows how the button is created.

Getting started: what do you need?

The following requirements should do the job to create WPF applications:

Tags:

Introduction

Since Microsoft launched the .Net 3.0 framework and the Expression Studio, developers are able to create "Rich User Interfaces".  So, there are no more excuses to make a crappy - gray looking - interface.

In this blog I try to post small tutorials on how to get stuff done with Expression Blend and Visual Studio.  These tutorials will be based on problems that I experienced when creating WPF windows applications and will always start with [File --> New Project].

Hope you enjoy!

Tags: