WPF

Snooping WPF: Tips and PowerShell tricks

by Nicholas Wolverson, on 18 Dec 2013

When moving back from web to desktop development, it’s easy to miss the quick feedback and update cycle enabled by the developer tools in modern web browsers. To an extent the debugger intermediate window does many of the things the console allows, and many of the “script debugging” features the...

Mapping in WPF, Silverlight and WP7

by Nicholas Wolverson, on 02 May 2012

In this article I show a simple example of integrating Bing and Google mapping into in WPF, Silverlight, and Windows Phone applications. I was inspired to investigate how easy it is to get up and running with maps on these platforms when I saw how similar the Bing APIs are...

A Simple Pattern for Creating Re-useable UserControls in WPF / Silverlight

by Colin Eberhardt, on 06 Feb 2012

This blog post provides step-by-step instructions for creating a user control, which exposes bindable properties, in WPF and Silverlight. The post covers dependency properties, and how to manage DataContext inheritance. When building user interfaces you will often find yourself repeating the same UI patterns across your application. After all, users...

Adding Error Bars to Visiblox Silverlight Charts

by Colin Eberhardt, on 21 Oct 2011

Having spent a number of years studying Physics at university, I have had the importance of error bars well and truly drummed into me! Within physics, or any experimental science, there are always going to be errors in the measurements you make. The more repeat measurements you make, the more...

Plotting user functions with Visiblox

by Nicholas Wolverson, on 10 Oct 2011

Some time ago I wrote about plotting mathematical functions with Visiblox Charts, and Jesse responded by showing how to wrap a function in a data series to feed into a chart. I'm going to show how to take this idea a bit further, generating additional data on interaction,...

Visiblox MVP Giveaway

by Colin Eberhardt, on 23 Jun 2011

Readers of my blog will probably have noticed that I have a keen interest in both charting and performance. My friends over at Visiblox have combined these both to create what is one of the fastest charts for WPF, Silverlight and Windows Phone 7, see my recent benchmark...

Mathematical-style plots: Retemplating Visiblox Charts

by Nicholas Wolverson, on 13 Jun 2011

This post demonstrates how to re-template a Visiblox Chart to render data with mathematical-style "on-chart" axes. Mathematical charts are usually drawn around the zero point, with the X and Y axes crossing at 0,0, and the plot drawn on top of the axes. In other fields, quantities which are never...

A Navigator Control For Visiblox Time Series Charts

by Colin Eberhardt, on 26 Jan 2011

In this blog post I will describe the creation of a simple range selector UserControl, which can be used alongside a Visiblox chart to create an interactive navigator for time series data. Whether you are studying finance, politics, meteorology or sociology you are sure to encounter time series data. Time...

A Simplified Grid Markup for Silverlight and WPF

by Colin Eberhardt, on 21 Dec 2010

The WPF / Silverlight syntax is long and cumbersome. This blog post describe a simple attached property that allows you to specify row and column widths / heights as a simple comma separated list, e.g. RowDefinitions="Auto,,3*,,,,2*" The Grid is probably one of the most useful and versatile layouts that Silverlight...

Visiblox Charts vs. amCharts Quick Charts

by Colin Eberhardt, on 20 Dec 2010

Around one week ago I published an article which compared the performance of Visibox charts to a few of its competitors. The results indicated that Visiblox was the fastest chart, with DynamicDataDisplay coming in a very close second. UPDATE: I have published a more up-to-date and...

Templates, or Why I love WPF (and Silverlight Too!)

by Colin Eberhardt, on 10 Sep 2010

This post compares the implementation of a simple ListBox layout with Windows Forms and Windows Presentation Foundation. The use of Templates within WPF are a clear winner over the WinForms 'owner draw' route. Application user interfaces are becoming much more graphical, with users expecting a more engaging and 'lively' experience....

A Universal Value Converter for WPF

by Colin Eberhardt, on 09 Jul 2010

This post provides a simple IValueConverter implementation that makes use of the framework type converters in order to convert between a large range of source / target types. This converter can be used both within bindings and in code-behind to give more concise property setters. Introduction One of the great...

Modal dialogs in cross-platform WPF/Silverlight applications

by Colin Eberhardt, on 18 Jun 2010

This blog post looks at the problem of showing modal dialog windows in applications that target both the Silverlight and WPF platforms. A solution is provided which allows modal dialogs to be written that work well for both technologies. Silverlight is, roughly speaking, a subset of Windows Presentation Foundation (WPF)....

Declarative Dependency Property Definition with T4 + DTE

by Colin Eberhardt, on 18 Aug 2009

UPDATE I have published a more up-to-date version of this code on codeproject, which allows you to automate the generation of much more than just dependency properties. This blog post describes a technique for specifying WPF / Silverlight Dependency Properties declaritively via attributes as illustrated by the following example:...

Silverlight 3 UK launch ... and the future of WPF?

by Colin Eberhardt, on 09 Jul 2009

A brief article on the launch of Silverlight 3 and why the interest in Silverlight is eclipsing that of WPF. The excitement behind Silverlight has been gaining in momentum throughout this year, with one of the highpoints being the MIX09 conference in March this year where the announcement of...

Silverlight Dependency Property Code Generation

by Colin Eberhardt, on 01 Apr 2009

This blog details a technique for generating Silverlight dependency properties from an XML file via a T4 template. If you just want to grab the code, scroll to the bottom of this article and download the sourcecode or cut and paste the templates. If you want to find out how...

Using CSS Selectors for Styling in WPF

by Colin Eberhardt, on 11 Mar 2009

When I first encountered WPF I was really impressed by its styling and templating features which are more powerful than anything else I had previously seen for desktop software development. The property-value pairing within styles instantly reminded me of CSS, however the WPF styles lack the most powerful feature of...

ElementName binding in Silverlight via Attached Behaviours

by Colin Eberhardt, on 22 Feb 2009

As a relative newcomer to Silverlight I was happily greeted by the warm feeling of familiarity when I started developing. It is surprisingly easy to make the transition from WPF to Silverlight developer, with most of the core concepts being just the same. However, there are some parts of the...

BindingGroups for Total View Validation

by Colin Eberhardt, on 26 Jan 2009

Over the weekend Sacha published a new article on codeproject, Total View Validation (does Sacha ever sleep?). This article addresses some of the perceived problems with the WPF binding framework, firstly, that the standard solution of using the ValidatesOnDataErrors property forces you to place validation logic into your...

WPF DataGrid - Committing changes cell-by-cell

by Colin Eberhardt, on 21 Jan 2009

In my recent codeproject article on the DataGrid I described a number of techniques for handling the updates to DataTables which are bound to the grid. These examples all worked on the assumption that you want to keep your database synchronised with the DataGrid, with changes being committed on...

Using BindingGroups for greater control over input validation

by Colin Eberhardt, on 28 Nov 2008

In a recent post on his blog Josh Smith described a technique for providing more meaningful error messages when the type conversion process fails within the binding framework. Consider the following problem; you bind an integer property of your object (Age for example) to a TextBox within your user interface....

Multiselect DataGrid with CheckBoxes

by Colin Eberhardt, on 26 Nov 2008

I am currently very interested in the new WPF DataGrid which was released on codeplex recently. Someone posted an interesting question in the codeplex forums asking about whether it would be possible to configure the DataGrid so that a user can make multiple row selections via checkboxes which...