WPF

WPF Tutorial - Increasing a Window's Border


Posted in:

Extending the window's frame is a design trend that is becoming popular in modern applications - especially browsers. Every major browser today (Chrome, Firefox, Internet Explorer, and Opera) uses this technique to increase the visual quality of their applications.

Today we're going to see how to duplicate this look in WPF. The approach we're going to take relies on the OS supporting Aero, which means only Vista and Windows 7 are supported. For Windows XP, you're going to have to find another solution.

Read More Icon Read More

WPF's Most Important Property - UseLayoutRounding


Posted in:

Ever since the introduction of WPF, applications developed using the technology have all had a similar look - fuzzy. In .NET 4, the developers at Microsoft made great strides in the clarity and readability of WPF applications.

Up until .NET 4, developers have used many tricks to get icons and line edges clearer than they are by default. Whereas some tricks may still be needed, one new property puts an end to much of the fuzziness frustration - UseLayoutRounding.

Read More Icon Read More

WPF DataGrid Tutorial - Row Headers


Posted in:

When using Data Grids to present data, row headers can be valuable additions - especially if the grid contains more columns than can fit on the screen at one time. Row headers don't scroll horizontally with the rest of the content, which means users can use them to see the context of the data they're viewing. This tutorial will demonstrate how to create row headers using WPF's DataGrid control.

Read More Icon Read More

WPF Snippet Tutorial - Binding a DataTable to a DataGrid


Posted in:

This is something that I expected to be straightforward - binding a DataTable to a WPF DataGrid. The problem is that DataTable doesn't implement IEnumerable, and unfortunately that's what the DataGrid's ItemsSource property requires.

Read More Icon Read More

WPF Tutorial - Forcing a Binding Update


Posted in:

Here's a common scenario - you've got a WPF control bound to a property that doesn't update when the value of the property changes. If the object you have access to doesn't implement INotifyPropertyChanged or use Dependency Properties, this can be a very common problem.

Read More Icon Read More

Kinect Tutorial - Hacking 101


Posted in:

Microsoft's Kinect has been out for a few months now and has become a fairly popular accessory for the Xbox 360. Let's face it though, using the Kinect for what it was intended didn't end up being the most exciting part of this new toy. What has become far more interesting is seeing the various hacks developed that makes the device so much more than simply an input mechanism for games. Now it's your turn to do something amazing, and this tutorial will get you started. Today I'm going to get your Kinect up and running and demonstrate how to get the camera and depth information into your very own C# application.

Read More Icon Read More

WPF Tutorial - Binding without XAML


Posted in:

The introduction of binding and XAML has made creating user interfaces in .NET a much more enjoyable experience compared to previous incarnations. Binding is such an integral part of the WPF experience that most developers thoroughly understand how to do it in XAML, however what we're going to look at today is how to create a binding using only C# code.

Read More Icon Read More

WPF Tutorial - Binding to a TabControl


Posted in:

Here's a very basic scenario - you've got a collection of items and you'd like to display a tab for each one inside a TabControl. The TabControl exposes a property called ItemsSource, however setting up the templates to control how to display your data is not quite as straight forward as you might think.

Read More Icon Read More

WPF 4 Lowers Default BitmapScalingMode Quality


Posted in:

If you've recently upgraded a .NET 3.5 WPF application to .NET 4.0, you may have noticed that some of your images look like crap. This is because Microsoft has changed how WPF rescales images. Instead of the original high quality, it has been lowered to low quality. This was done, they say, to improve performance.

Read More Icon Read More

WPF Tutorial - Binding Validation Rules


Posted in:

Bindings are a major part of WPF, and a big part of what makes it quick to create user interfaces in. They can be a little wordy and hard to debug sometimes, but overall they are extremely useful. Hopefully, after today's tutorial, you will find them even more useful - because today we are going to talk about building validation rules right into your bindings. Yup, you heard right - bindings in WPF have built in support for validation, and a number of the common controls have built in ways for displaying validation errors.

Read More Icon Read More