Feed on
Posts
Comments

Category Archive for '.NET'

When starting with generics, I was somewhat suprised that something like this didn’t work:
 

public interface IAnimal
{
}

public class Pig : IAnimal
{
}

public class AnimalFarm
{
private ObservableCollection<Pig> pigs;

public IEnumerable<IAnimal> Animals
{
get { return pigs; } //DOES NOT COMPILE
}
}

 
The problem is that generics aren’t covariant, which is sometimes a [...]

Read Full Post »

Just two extension methods I wrote in order to simplify testing of classes that implement INotifyPropertyChanged.
The first one just checks that the PropertyChanged event fires once and for the specified property:
 

/// <summary>
/// Checks whether a given action produces a change event for
/// a given property.
/// </summary>
/// <typeparam name=”T”>A class that implements <see cref=”INotifyPropertyChanged”/>.
/// </typeparam>
/// <param [...]

Read Full Post »

After having worked mostly conceptually for a few months (a detour to enterprise messaging), I’m back to writing code and getting my hands dirty. And I finally managed to get the time to start playing with Windows Workflow
To me, learning is all about playing around with the technology, and here’s a first result [...]

Read Full Post »

Transitionals is a WPF framework that allows you to integrate nice transition effects into your WPF application with very little effort. It’s gone live a few days ago on CodePlex and definitely worth checking out:
http://www.codeplex.com/transitionals
 
I’ve downloaded the library today in order to incorporate a little eye candy into a prototype I’m doing. However, what I [...]

Read Full Post »

Scott Guthrie has posted a great summary about the various improvements of the upcoming SP1 for both Visual Studio 2008 and .NET 3.5. No matter what kind of development you’re currently involved with, there’s definitely something to be really looking foward to
A beta is available now, the final release can be expected this [...]

Read Full Post »

Already tried to extend the Binding or BindingBase classes in order to write your own custom bindings? And failed because BindingBase.ProvideValue is sealed? Me too…
The result is a MarkupExtension that works around the issue that you cannot properly extend the Binding class. Basically, it allows you to write binding expressions with the usual syntax without [...]

Read Full Post »

I’m currently working on a custom markup extension and came over a pretty nasty issue. Here’s the working XAML of a dummy extension:

<TextBox Name=”txtCity”
Foreground=”{local:ColorExtension Color=Red}”
/>

 
This works like a charm - the fore color is set to red as expected. However - as soon as I try to set the Color property through [...]

Read Full Post »

WPF TreeView Update

I’ve posted an update for my WPF TreeView which contains a bugfix and two new features:

The root item collection is now monitored for changes, and the tree updates itself automatically. This behaviour, however, can be controlled through the ObserveRootItems dependency property.
Built-in filtering support through a strongly typed predicate. I’m not completely [...]

Read Full Post »

Automatic properties in .NET 3.5 are a nice thing, but they are out of the equation if you want to take advantage of the almighty INotifyPropertyChanged interface which plays a crucial role in WPF. Here’s a set of ReSharper snippets that simplify interface implementation and property declaration.
Event Declaration
The first snippet just prints out an interface [...]

Read Full Post »

Agreed - the WPF learning curve is steep, but once one figures out how the basics work, things tend to get amazingly easy. And of course, the emerging sets of toolkits dont’t hurt either.
Here’s another sample - a customer of mine needed a utility to maintain data in their web shop (MySql) and update the [...]

Read Full Post »

Next »