WPF “Tip of the Day” window

Sometimes, your end-users aren’t the smartest creatures on the planet. Lots of times, I am talking to an end-user because there is a “bug” or “critical issue” that needs to be fixed right away.

During the “debug” session (read: using the software as the end-user has described), you hit a lot of key strokes and other useful shortcuts that I thought the user was already familiar with. Unfortunately, most of the time, they are not.

Therefore, the Tip of the Day window is a great way of showing the end-user some handy tips when they start your software. For example, to learn about shortcuts, “hidden” features and more. The window of this post just does that:

tip_of_the_day

The window is really easy to use, you will just need to call the following code in the startup (or any location you like) of your software:

TipOfTheDayWindow tipOfTheDayWindow = new TipOfTheDayWindow();
if (tipOfTheDayWindow.HasTipsToShow)
{
    tipOfTheDayWindow.ShowDialog();
}

You must be thinking: why a blog post for such an easy window? Well, because this “Tip of the Day” window has much more features than you can see on first sight. For example, did you ever think on how to enter or manage the tips? Well, this window takes care of that for you.

Simply hit CTRL + F2 when the “Tip of the Day” window is focused, and you will see the following edit mode:

tip_of_the_day_editor

With the included editor, you can simply create, modify, remove and preview all the tips that are included with the window. The tips are stored in xml format in a subdirectory “Help”.

Don’t wait too long, start using the “Tip of the Day” window today!

TipOfTheDayWindow.zip (295.57 kb) [Downloads: 19]

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

System.AddIn Pipeline Builder

I am using the System.AddIn namespace in a very large project for a customer. The project consists of a host and the actual functionality is implemented in the add-ins.

Writing the pipeline can be a very slow and painful process, since you will have to write the contracts, and then the adapters yourself. Fortunately, the CLR team for the System.AddIn namespace created a Pipeline Builder project on CodePlex. The idea is very good, but unfortunately there are 2 flaws in it:

  1. It contains some bugs and is not completely finished yet
  2. It is not supported any longer (last update on July 3rd, 2008)

Since we use subversion, and the original pipeline builder project kept deleting the subversion files, I customized some code to support subversion, but the pipeline builder was still far from perfect.

Recently, I discovered that more people were “suffering” from the lack of support on the pipeline builder and decided to start their own version with all the bug fixes posted so far.

You can find the new Pipeline Builder project here at CodePlex.

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

WPF TraceOutputControl

Lately (actually, the last few years :)), I have been developing a lot of applications using WPF. One of the “nasty” things about WPF development is that binding errors are written to the output window, but that I currently have other windows open as well (and I don’t want the output window of Visual Studio to be open all of the time). Another drawback of the output window is that it does not support runtime filtering and clear feedback that an error has occurred (for example, in red).

I noticed that I was writing a quick and dirty output window for every project to be able to view the binding expression errors in the application itself. I also noticed that other developers were having the same issues and I decided to create a simple, ready-to-use, user control that supports output tracing with filtering.

Demo_screenshot

With this control, you can debug your application much easier and you will notice that an error or warning has occurred :). You can also decide to skip all the verbose output at runtime and simply filter on warning and errors only.

TraceOutputControl.zip (395.18 kb) [Downloads: 70]

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

DataWindow – Quickly create basic windows in WPF

When developing software in WPF, I always need the following three types of windows:

  • OK / Cancel buttons for data windows;
  • OK / Cancel / Apply buttons for application settings / options;
  • Close button on windows for action windows.

Creating these windows is just boring and the steps are always the same:

  1. Create a WrapPanel at the bottom of the window
  2. Add the buttons with the same RoutedUICommand objects over and over again

The attached class makes it much easier to create these basic windows, simply by specifying the mode of the Window. By using this window, you can concentrate on the actual implementation and you don’t have to worry about the implementation of the buttons itself, which saves you time!

DataWindow demo

Using the class is very easy. Simply derive the Window class from DataWindow instead of Window. The demo application should give you enough information on how to proceed.

20091203 - DataWindow.zip (342.70 kb) [Downloads: 65]

kick it on DotNetKicks.com 

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

WPF ComboBoxEx

Some time ago, I needed a combobox in WPF to support an empty value (null), so the user was able to deselect or undo a selection. Unfortunately, this was not supported by the standard ComboBox class WPF offers.

Therefore, I decided to create my own combobox, with a “lot” of additional features that I think a combobox must support for a developer to be really useful. The attached ComboBoxEx class is the result, and it adds the following features to the standard ComboBox class:

  • Automatically select the value if only one item is available in the items source;
  • Support the MaxLength property when IsEditable property is enabled;
  • Keep selected value selected when updating the items source;
  • Disable the control when no items are in the items source;
  • Support an empty item, which can be null, but also a default value that can be specified.

A full demo application of all features is included in the package.

comboboxex

comboboxex.zip (34.12 kb) [Downloads: 110]

kick it on DotNetKicks.com

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList