Firefox 3.5 released

old Firefox iconnew Firefox iconSee title 😀

I hope that there will soon be 3.5 compatible versions of the addons installed in my FF (especially I’m missing TabMixPlus).

One change is very obvious: The new icon (left image). It differs a little bit from the old one (right image). In my opinion it looks a little bit moderner.

Performance: I had no time for real surfing yet. However, the WordPress Dashboard (very much expensive JavaScript) seems to be much faster now.

A better Windows 7 support is still not included – no customized Jump List and no tab preview.

Posted in Firefox. Tags: , , , . Comments Off on Firefox 3.5 released

MVVM Part 5: IUserInterface

This posting shows how to abstract the user interface in a WPF MVVM application. We will see how the IUserInterface interface helps us reducing the coupeling between the ViewModel classes and UserControls / Windows.

Note: This posting is part of a series. See MVVM-Library for other parts and download.

It has been some time ago since I published the last part “Commanding”. I hope you didn’t loose the interest in my blog meanwhile 😉

Today, we will concentrate on another, very important aspect: Letting the ViewModels open new Views (in fact we are only preparing for that step).

Bad solution

As the ViewModels should not know about their concrete views, it would be very bad to write code like that in a ViewModel class:

Window window = new Window();
window.DataContext = new FooViewModel();
window.Child = new FooView();


Read the rest of this entry »

Posted in My interpretation of MVVM, WPF. Tags: , , , , . Comments Off on MVVM Part 5: IUserInterface

Find out Size (and position) of the taskbar

What size is the taskbar on this computer? And where is it at all? This post has the answer.

A common problem is to find out the size and the location of the taskbar.

Almost as common as the problem is the following solution:

public static int GetTaskbarHeight()
    return Screen.PrimaryScreen.Bounds.Height - Screen.PrimaryScreen.WorkingArea.Height;

At least, it is better than hardcoding the height in code. And it will work on lots of machines.

However, it has some really bad disadvantages:

Read the rest of this entry »

Implementing (IComparable<T>), IEquatable<T> and the equality members

IComparable<T>, IEquantable<T>, IHaveTheSolution

Reading through the web I hit upon two blog posts (Classes implementing IComparable<T> and null (German) and the following post Classes implementing IComparable<T> and null the second (German)). In the first one there was a discussion about how to implement the “equality members” (Equals, IEquatable<T> and the equality operators).

One problem was, that overriding the equality operator (==) so that it calls Equals makes an implementation of Equals as follows impossible (lets say our class is called Foo):

Read the rest of this entry »

Latest WPF Toolkit (June 2009) contains “Silverlight Charts”

If you were impressed by the chart controls in the Silverlight Toolkit and you are targeting WPF (like me), you’ll be happy to hear that the latest WPF Toolkit contains a ported versions of them (both versions are apparently fully compatible):

WPF Charting: It’s official! [June 2009 release of the WPF Toolkit is now available!]

The controls seem to be fully MVVM-conform.

Take a look at the screenshot from the sample application posted in that blog:

WPF Charts - Screenshot

DotNetKicks Image
Posted in WPF. Tags: , , , . Comments Off on Latest WPF Toolkit (June 2009) contains “Silverlight Charts”

No interface without contract? – Part 2: About Pre- and Postconditions

Pre- and Postconditions: What they are, why you should use them and how they help you.

In the last part, the result was that we need something helping us to specify those kinds of “Implementation-Requirements”.

I already alluded to Pre- and Postconditions.

Read the rest of this entry »

Pitfalls and Best Practices to prevent them #3: this and base

“I use base to make clear that I am calling a inherited member” – why you shouldn’t.

You all know them: The keywords this and base.

Did you ever think about which of them you should use when you can use both?

Read the rest of this entry »