Feed on
Posts
Comments

Monthly Archive for March, 2008

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 »

A WPF File Selection control

 
This is a pretty simple user control, which allows you to display a file dialog to open or save files. Its look can be easily adjusted, and it provides built-in truncation of the file string to a predefined length if necessary. Here’s the XAML for the above sample control:

<files:FileSelector x:Name=”openFileSelector”
[...]

Read Full Post »

New Blendables

Just saw that Blendables have extended their portfolio of WPF controls. The stuff looks good, but unfortunately, their licensing scheme doesn’t:
A license is required for each machine utilizing the blendables controls. [...] As we do not offer a deactivation method, if you must reactivate on a new developer machine you are allowed up to 3 [...]

Read Full Post »

If you have a WPF TreeView control that shows nested data, and you don’t want the user to select nodes that contain child nodes, you can solve this declaratively as TreeViewItem provides all we need:

HasItems dependency property (bool)
Focusable dependency property (bool)

As both properties have the same type, you can use a binding expression (needs inversion [...]

Read Full Post »

A KeyedCollection for int keys

I’m using this class so much that I thought I’d share it with you. This generic class is an implementation of the KeyedCollection<TKey, TItem> class for items that have a numeric key:
public abstract class NumericallyKeyedCollection<T> : KeyedCollection<int, T>{ }
Using int-Keys takes a bit more work than other types, because KeyedCollection provides indexers for both key [...]

Read Full Post »