Knowledge: Tech Blog

Where we share our thoughts on technology and design.

.NET

Nick Soper

Hosting .NET Core on Linux with Docker - A Noob's guide

This blog describes my experience of upgrading a basic RESTful API from .NET Core RC1 to .NET Core 1.0, and using Docker to host it on Linux. Docker is completely new to me so I'll give my thoughts as a noob.

Nick Soper

ASP.NET 5 to ASP.NET Core 1.0

Literally a couple of hours after we released the previous post on writing a RESTful API with ASP.NET 5, I learned that Microsoft have renamed the new platform. This is a very short summary of that decision.

Nick Soper

Building a RESTful API with ASP.NET 5

This blog describes my first experience of writing a RESTful API with Microsoft's new MVC 6 framework which is due to be released as part of ASP.NET 5 in early 2016.

Thomas Kelly

Generalizing OData

OData Controllers offer an easy interface between data and your application, but require one controller per model type. These controllers often have a large amount of almost identical code. In this blog post, we look at using C# Generics to remove this duplication.

Ian Sullivan

What Makes a Good CMS?

Code quality is important in large systems and web sites are no exception. This post shows how Umbraco enables developers to write clean and maintainable code.

Effrosyni Kouri

Introduction to ASP.NET 5

This blog post discusses the changes to the .NET framework, the solution layout / configuration and serves as an introduction to the recommended programming style encouraged by Microsoft going forwards.

Ian Sullivan

Generating Type-Safe Email Templates Using Single File Generators

This post shows how 'single file generators' can be used to generate type-safe email templates

Andy Lee

Asp.Net bundling of Angular templates

How to use Asp.Net's built-in bundling and optimisation feature to optimise AngularJS templates

Nicholas Wolverson

Snooping WPF: Tips and PowerShell tricks

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...

Nicholas Wolverson

Interactive.NET (2 - C#)

In the previous part of this series discussing running an interactive environment (REPL) on .NET I covered the non-C# options. This post explores the options for an interactive or lightweight C# environment.

Nicholas Wolverson

Interactive.NET (1)

In the first part of a series on running an interactive environment (REPL) on .NET, I talk a little about why you might want one, and cover the non-C# options.

Colin Eberhardt

Introducing PropertyCross - Helping you select a cross-platform mobile framework

Introduces a new open source project that helps developers choose a suitable cross-platform framework

Rolf Baxter

PDF Generation and Printing in .NET

In this post I'm going to talk about creating PDF documents in C#. I will primarily focus on the PdfSharp and MigraDoc libraries, which are free C# libraries available from http://www.pdfsharp.net/. I recently became acquainted with them while investigating .NET exporting functionality and wanted to blog about my experience and...

Colin Eberhardt

Book Review: iOS Programming for .NET Developers

A couple of weeks ago Josh Smith published his latest book, "iOS Programming for .NET Developers", which seeks to ease the transition from .NET to iOS developers. As someone who has many years of .NET experience, and more recently a desire to develop for 'the other side', I thought this...

Colin Eberhardt

An Introduction and Thoughts on Developing iOS Applications with MonoTouch

This blog post describes the creation of a simple twitter search application for iOS, based on a similar application I wrote for Windows Phone a few months back. In this blog post I'll used the MonoTouch platform, which allows you to write iOS applications using C#. This blog posts describes...

Colin Eberhardt

A gesture-driven Windows Phone to-do application Part Two - drag re-ordering

A couple of weeks ago I blogged about a todo list application which uses gestures to achieve its basic functions, a left swipe deletes an item, while a right-swipe marks it as complete. In this blog post I am adding re-ordering which is initiated via a tap-and-hold gesture and performed...

Chris Grant

Creating a Telemetry Application using Silverlight, Visiblox and Custom Controls

Introduction About a month ago, I was using the MoTeC i2 Data Analysis software to look through some telemetry data that I had exported from a popular racing simulator game. Although MoTeC is feature rich and a great tool for motor racing professionals and enthusiasts, I had the idea to...

Colin Eberhardt

A gesture-driven Windows Phone to-do application

This blog post describes the implementation of a gesture-based todo-list application. The simple interface is controlled entirely by drag, flick and swipe: So far the application supports deletion and completion of tasks, but not the addition of new ones. I'll get to this in a later blog post! Introduction -...

Chris Grant

Creating an Earthquake Monitoring Application with Visiblox

This post describes how to develop an Earthquake Monitor application based on live data from the USGS, using Silverlight, the MVVM Pattern, Visiblox and the Silverlight Bing Maps Interactive SDK.

Rolf Baxter

Developing an extended Drag And Drop TreeView control in C# .Net

This blog post talks about developing an extended Drag and Drop TreeView control in C#. I say extended because the .Net framework already provides simple drag and drop functionality, but the visual feedback during the drag operation is somewhat lacking. I found a number of TreeView extensions on CodeProject, some...

Nicholas Wolverson

Mapping in WPF, Silverlight and WP7

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...

Colin Eberhardt

WPF Charting Performance Comparisons (the Battle Continues)

This blog post presents a thorough analysis of the performance of various WPF Charting components. The results show that a new class of charting solutions, which use raster-based graphics as opposed to retained mode vector graphics, provide a considerable performance advantage

Colin Eberhardt

Everything you wanted to know about databinding in WPF, Silverlight and WP7 (Part Two)

Introduction This is the second post in my series about databinding in Silverlight and WPF. In the first post I looked at how you wire-up UI controls to a model in the absence of a databinding framework. I showed how databindings can be created in code-behind, removing the need for...

Colin Eberhardt

Everything you wanted to know about databinding in WPF, Silverlight and WP7 (Part One)

OK, so the title is a little ambitious, but there is nothing wrong with setting yourself lofty aims! Because of the depth of this topic I have decided to split this tutorial up into a series of blog posts, each of which explore a different aspect of the binding framework....

Colin Eberhardt

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

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...

Colin Eberhardt

Windows Phone 7 - Browsing your Photos via Bing Maps

The Windows Phone 7 camera gives you the option to record the location where a picture was taken (under Settings => applications => pictures+camera). With this feature turned on, each application has their latitude, longitude and altitude stored as part of the standard EXIF data. I thought it would be...

Colin Eberhardt

FastClick for WP7 - Improving Browser Responsiveness for PhoneGap Apps

I recently released an update of the HTML5 / PhoneGap application I wrote a few months ago to the marketplace. This update fixed the location detection issue, where the marketplace certification process failed to detect that the application was using geolocation data via the browser (this issue has been fixed...

Colin Eberhardt

A Festive and Fun Windows Phone 7 Maze Game

Last night, with my Christmas presents all wrapped and a lack of any decent programmes (festive or otherwise) on television, I had a few hours to kill, so decided to create a festive-themed WP7 game ... Ever since I first started writing code for Windows Phone 7 I have wanted...

Colin Eberhardt

A Simple Multi-Page Windows Phone 7 PhoneGap Example

This blog post shows how you can use PhoneGap to create Windows Phone 7 applications that are comprised of multiple, simple HTML pages, whilst meeting the Marketplace certification requirements. Colin Eberhardt is a Scott Logic technical Evangelist and a Technical Architect for Visiblox, suppliers of high-performance WPF and Silverlight charts....

Colin Eberhardt

A Windows Phone 7 Slide View with Page Pips

A popular user-interface in the iOS world is the UIPageControl which renders a small set of dots to indicate the number of pages, with the current page highlighted in some way. This is often used in conjunction with a UIScrollView to navigate between pages in a multi-page layout. Windows Phone...

Colin Eberhardt

Pushpin Clustering with the Windows Phone 7 Bing Map control

This blog post provides a simple utility class that will cluster pushpins on a Bing Map control. This utility provides a way to achieve great performance with 1000s of pushpins. The Bing Map control for Windows Phone 7 is a versatile control, allowing you to provide your users with an...

Colin Eberhardt

Suppressing Zoom and Scroll interactions in the Windows Phone 7 WebBrowser Control

This blog post describes a simple helper class that can be used to supress scrolling and pinch zoom of the Windows Phone 7 WebBrowser control. Colin Eberhardt is a Scott Logic technical Evangelist and a Technical Architect for Visiblox, suppliers of high-performance WPF and Silverlight charts. Developers of Windows Phone...

Colin Eberhardt

An Introduction to Semantic Zoom in Windows 8 Metro

With the new Metro UI, Windows 8 has firmly embraced the tablet form-factor, with the interface tailored for touch and multi-touch interactions. Many of the Metro concepts familiar to Windows Phone 7 (WP7) developers are also present in Windows 8. Watching the vieos from the //build/ conference you can see...

Colin Eberhardt

Codeproject September Competition - Scored a Double!

I have just received an email from Codeproject - my article on XAMLFinance, a cross platform Silverlight, WPF and WP7 application, has won Best C# and Best Overall article competitions for September. Having narrowly missed out in the monthly competitions a few times, I am pleased to have scored a...

Colin Eberhardt

Adding Error Bars to Visiblox Silverlight Charts

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...

Colin Eberhardt

WinRT Transitions - Creating Fast and Fluid Metro UIs

This blog post looks at the new concept of 'transitions' that WinRT, within Windows 8, introduces. This concept makes it very easy for you to create a fluid and interactive UI without going anywhere near storyboards! I have to admit it, I am a big fan of the Metro Design...

Nicholas Wolverson

Plotting user functions with Visiblox

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, and allowing...

Colin Eberhardt

Using ObservableCollection with WinRT (via a little shim!)

WInRT introduces a new interface for collection change notification, IObservableVector, which means ObservableCollection no longer works with this framework. In this blog post I will show how you can use ObservableCollection, via a simple adapter, within you WInRT applications. <ItemsControl ItemsSource="{Binding Path=MyCollection, Converter={StaticResource ObservableCollectionAdapter}}"/> Developers are slowly starting to get...

Colin Eberhardt

A Windows Phone 7.1 (Mango) MVVM Tombstoning Example

In this blog post I look at the new application lifecycle model that Windows Phone 7.1 (Mango) introduces, and show how to handle the various lifecycle events in a simple MVVM application. In a previous blog post I described the development of a simple Windows Phone 7 application using the...

Colin Eberhardt

XAML Finance - a cross-platform WPF, Silverlight, WP7 application

I have just published a new article on codeproject which describes the development of XAMLFinance, a cross-platform application for the desktop (WPF), web (Silverlight) and phone (WP7). Head over to codeproject to read about the development of this application and download the sourcecode. Regards, Colin E.

Colin Eberhardt

TweetSearch - A Cross platform Metro UI WinRT and Silverlight Application

With the Windows 8 preview release earlier this week, developers are now faced with a whole new and exciting Microsoft stack. The Windows 8 architecture has something of a split-personality, incorporating a completely new runtime, WinRT together with the older Win32 and .NET framework. However, these sit on different sides...

Colin Eberhardt

Implementing a Windows Phone 7 Conversation View Part Two

This blog post describes how to implement a conversation / messaging style application with Windows Phone 7. It covers how to style the speech bubbles and the scrolling of the conversation list view when the phone keyboard is shown. A couple of weeks ago I wrote a blog post which...

Colin Eberhardt

Capturing Windows Phone 7 Panorama Images

The Windows Phone 7 Panorama control is widely used in applications and to many has come to symbolise the Metro Design Language. Search for panorama images and you will find numerous promo-shots of Windows Phone 7 applications which display the panoramic contents of the application hub, with an image of...

Colin Eberhardt

Implementing a Windows Phone 7 Conversation View

This blog post looks at how to to create a conversation view, mimicking the SMS messaging interface within Windows Phone 7. This post shows how we can select different DataTemplate for each item in an ItemsControl to achieve this effect. The Windows Phone 7 SMS messaging interface graphically illustrates between...

Colin Eberhardt

Silverlight UK User Group Presentation on Cross Platform XAML

Earlier this week I presented a talk to the Silverlight UK User Group on cross-platform application development with WPF, Silverlight and Windows Phone 7. Thanks to Gergley Orosz for these pictures Thanks to all who attended my talk. Here is a copy of the presentation I gave: You can see...

Colin Eberhardt

Visiblox MVP Giveaway

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 blog post...

Colin Eberhardt

Metro In Motion #8 - AutoCompleteBox Reveal Animation

When I started the Metro In Motion series, I thought I would probably post three or four articles and be done. However, every time I use my Windows Phone 7 I seem to spot a new 'native' fluid UI effect which I would like to use in my own code....

Colin Eberhardt

Metro In Motion Part #7 - Panorama Prettiness and Opacity

This blog post details a simple metro-in-motion behaviour which reduces the Panorama control's contents while the user slides from item-to-item so that they can really appreciate your fancy background graphic! For those of you who have not been following my Metro-In-Motion series, I'll briefly recap. My aim is to provide...

Nicholas Wolverson

Mathematical-style plots: Retemplating Visiblox Charts

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...

Colin Eberhardt

Metro In Motion Part #6 - Rolling List Location Indicator

This blog post describes the development of a rolling list location indicator. This indicator mirrors the behaviour seen in the native Windows Phone 7 calendar which rolls from one date to the next as the user scrolls. For those of you who have not been following my Metro-In-Motion series, I'll...

Colin Eberhardt

A Simple Windows Phone 7 MVVM Tombstoning Example

This blog post shows how to implement tombstoning within a Windows Phone 7 application that following the Model-View-ViewModel pattern. UPDATE: I have published a update to this blog post to handle the new dormant state in Windows Phone 7.1 (Mango). Colin Eberhardt is a Scott Logic technical Evangelist and a...

Colin Eberhardt

Metro In Motion #5 - SandwichFlow

For the past few months I have been writing a Metro-In-Motion blog series which describes how to recreate some of the fluid effects found in native Windows Phone 7 applications within your own applications. So far I have covered fluid list animations, 'peel' animations, flying titles and a 'tilt' effect...

Colin Eberhardt

Metro In Motion Part #4 - Tilt Effect

This blog post describes the implementation of a metro 'tilt' effect for Windows Phone 7 which causes element to respond to user interactions by tilting in 3D So far in the "Metro In Motion" series I have covered fluid list animations, 'peel' animations and flying title. In this blog post...

Colin Eberhardt

ViewModel INotifyPropertyChanged Code Generation

This blog post describes a novel method of generating boiler-plate MVVM code using codesnippet automation. You simply add attributes to your view model classes and the code is generated for you! Model-View-ViewModel (MVVM) has become the de facto pattern for Silverlight, WPF and WP7 applications, providing code that is easily...

Colin Eberhardt

A Fast Loading Windows Phone 7 NavigationList Control

This blog post describes a Windows Phone 7 NavigationList control, a list control designed for navigation pages. The NavigationList renders twice as fast as a ListBox and has a slightly simpler API. A few months ago I blogged about the relative performance of the Windows Phone 7 emulator versus the...

Colin Eberhardt

Metro In Motion Part #3 - Flying Titles!

In this blog post I look at how to implement the fly-out fly-in effect seen in native Windows Phone 7 applications. This effect is seen in the native mail application; when you click on a message, the title flies out of the list then flies back in as the title...

Colin Eberhardt

Metro In Motion Part #2 - 'Peel' Animations

This blog post is part #2 of my Metro In Motion series. In this post I demonstrate how to implement the animated 'peel' effect seen when native Windows Phone 7 applications exit. In my previous blog post I discussed how the Metro Design Language that heavily influences the Windows Phone...

Colin Eberhardt

Metro In Motion Part #1 - Fluid List Animation

This blog post presents an attached behaviour that gracefully slides the contents of a list into view when used in conjunction with a Pivot control, emulating the Windows Phone 7 email application. The Windows Phone 7 user interface is based on the Metro Design Language, which favours clear typography, content...

Colin Eberhardt

MVVM Charting - Binding Multiple Series to a Visiblox Chart

This post describes a method of using attached properties to bind a ViewModel which contains multiple data series to a Visiblox chart without any code-behind. The Visiblox chart supports databinding in both WPF and Silverlight, where the X and Y values for each datapoint are bound to properties on an...

Colin Eberhardt

Google Sky on Windows Phone 7

This blog post shows just how easy it is to use Google Sky as a tile source for Bing Maps, bringing the universe to Windows Phone 7! Personally I think mapping is one of the most exciting forms of application for mobile devices - the fantastic imagery available from Bing...

Colin Eberhardt

A Circular ProgressBar Style using an Attached ViewModel

This blog post describes how to re-template the Silverlight ProgressBar control to render a circular progress indicator. This approach uses an attached view model to circumnavigate some of the limitations of the ProgressBar design. This blog post describes the creation of the following funky styles for the ProgressBar (and a...

Colin Eberhardt

Automatically Showing ToolTips on a Trimmed TextBlock (Silverlight + WPF)

Both WPF and Silverlight have a property TextTrimming="WordEllipsis", which trims the text that a TextBlock displays based on the available width. This blog post describes a simple method for automatically showing the full text as a tooltip whenever the text is trimmed. This is presented as an attached behaviour and...

Colin Eberhardt

Windows Phone 7 DeferredLoadContentControl

This blog post describes a simple content control that can be used to defer the rendering of its contents in order to provide a better user experience on Windows Phone 7. I think anyone who has made the transition from Emulator to Hardware with developing for Windows Phone 7 has...

Colin Eberhardt

A Navigator Control For Visiblox Time Series Charts

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...

Colin Eberhardt

A Windows Phone 7 Jump List Control

This blog post presents a Windows Phone 7 Jump List control that I have developed.This post describes the API in detail and includes full sourcecode. Feel free to use and enjoy! The video below shows the control working on the emulator, the video further down this page shows it working...

Colin Eberhardt

Automatically Showing ToolTips on a Trimmed TextBlock (Silverlight)

Silverlight 4 added TextTrimming="WordEllipsis", which trims the text that a TextBlock displays based on the available width. This blog post describes a simple method for automatically showing the full text as a tooltip whenever the text is trimmed. This is presented as an attached behaviour. UPDATE: I have updated this...

Colin Eberhardt

A Simplified Grid Markup for Silverlight and WPF

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...

Colin Eberhardt

Visiblox Charts vs. amCharts Quick Charts

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 extensive test of WPF...

Colin Eberhardt

Visiblox, Visifire, DynamicDataDisplay - Charting Performance Comparison

A few weeks ago I published a blog post which compared the performance of the Visiblox charts and the Silverlight Toolkit charts. The results indicated that the Visblox charts are considerably faster than the Toolkit charts, however Microsoft's David Anson did point out that the Toolkit charts were not designed...

Colin Eberhardt

Adding a Smoothed Line Series (Bézier curve) to a Visiblox Chart

In this blog post I look at how to add a new series type to the Visiblox charts by creating my own series type which renders a smoothed line using a Bézier curve. This blog post describes how to create a new series type for the Visiblox charts, a spline...

Jonathan Cardy

Introduction to Parallelism in .NET 4.0

Back in the day, processors had a single core and clock speeds increased steadily every year. This meant that although writing multi-threaded code for a single CPU gave some performance improvements (since single-core CPUs usually try to execute multiple threads), it was hardly the top of any developer's list of...

Colin Eberhardt

Using a Grid as the Panel for an ItemsControl

In this blog post I look at how to use a Grid as the ItemsPanel for an ItemsControl, solving a few of the issues that crop up along the way. The Grid is probably the most useful of Silverlight and WPF's panels (panels are elements which provide a mechanism for...

Colin Eberhardt

Visiblox Charts vs. Silverlight Toolkit Charts - a test of Performance

This blog post compares the performance of the Visiblox and Silverlight Toolkit charts using a simple image processing tool to test and illustrate their differences in performance. The results show that the Visiblox charts are approximately 50 - 100 times faster that the Silverlight Toolkit charts. UPDATE: I have published...

Colin Eberhardt

Does HTML5 mean the end is in sight for Silverlight?

This blog post looks at the fallout after last week's PDC conference where Microsoft were quoted as saying "our strategy on Silverlight has shifted", and the resulting fallout in the developer community. In this post I will describe why I think Silverlight has a future ahead of it and exactly...

Colin Eberhardt

Silverlight as an alternative to PowerPoint

Recently I gave a presentation on cross platform application development with Silverlight, WPF and WP7. I wanted to move away from the standard PowerPoint bullet-point driven presentation style, so decided to create a presentation as a Silverlight application running in full-screen mode. This blog post describes the steps I took...

Colin Eberhardt

White Paper: Silverlight, WPF and Windows Phone 7 cross platform development

Last week I gave a presentation at a joint Scott Logic / Microsoft event about how WPF and Silverlight are unifying the development platform for desktop, web and mobile. To accompany the talk I wrote a white paper which delves into this subject in a little more detail. You can...

Colin Eberhardt

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

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....

Colin Eberhardt

Silverlight MultiBinding updated, adding support for ElementName and TwoWay binding

This blog post describes an update to the Silverlight 4 MultiBinding technique I blogged about a couple of months ago to add support for ElementName binding and TwoWay binding. A few months ago I posted an update to my MultiBinding solution for Silverlight 4. This technique allows you to perform...

Colin Eberhardt

Exposing and Binding to a Silverlight ScrollViewer's Scrollbars

The Silverlight ScrollViewer exposes readonly properties which indicate the current vertical and horizontal scroll offset, and methods for setting the current offset. In this blog post I demonstrate a simple attached behaviour that exposes these offsets as read / write dependency properties allowing them to be bound to. The Silverlight...

Colin Eberhardt

A Universal Value Converter for WPF

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...

Colin Eberhardt

Modal dialogs in cross-platform WPF/Silverlight applications

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)....

Colin Eberhardt

Throttling Silverlight Mouse Events to Keep the UI Responsive

If your Silverlight application performs intensive updates to the UI during mouse events, the UI can freeze because it is invalidated before it has a chance to render. This post describes a technique for 'throttling' mouse events to ensure that each time an event occurs, the UI has the opportunity...

Colin Eberhardt

Silverlight MultiBinding solution for Silverlight 4

In this post I describe an update to the Silverlight MultiBinding solution I presented last year. This update includes support for Silverlight 4, attached properties and multiple bindings on a single object. UPDATE: I have updated this code to include ElementName and TwoWay binding. Grab the latest copy here. MultiBinding...

Colin Eberhardt

Binding a Silverlight 3 DataGrid to dynamic data via IDictionary (Updated)

In this post I demonstrate a method for binding a Silverlight 3 DataGrid to dynamic data, i.e. data which does not have properties that are known at design time. This technique results in a bound grid which is sortable and editable. This blog post is a bug fix (due to...

Colin Eberhardt

Linq to Visual Tree

This blog post demonstrates a Linq API which can be used to query the WPF / Silverlight Visual Tree. You can find a few other Linq to Visual Tree techniques on other blogs, but what makes this one unique is that it retains, and allows queries that make use of...

Colin Eberhardt

Forcing Event Consumer Cleanup without Weak Events

This blog post describes a simple technique for ensuring that consumers of events unsubscribe their event handlers without the need for weak events. I think the concept of managed memory, where the cleanup of unused objects from the heap is performed by a garbage collector, is a fantastic idea. It...

Colin Eberhardt

My Mix10k entry - Old Skool demo - plus a few tips

This blog post is about my entry to the Mix10k code competition, and old-skool demo, plus a few tips about how to keep you code size to below 10k. The mix10k challenge, where you are given 10k to create a Silverlight / HTML5 application, has been on my mind for...

Colin Eberhardt

Declarative Dependency Property Definition with T4 + DTE

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: [DependencyPropertyDecl("Maximum",...

Colin Eberhardt

The mini-ViewModel pattern

The construction of a ViewModel is often seen as the standard technique for solving binding problems within WPF and Silverlight. However, the addition of a ViewModel adds complexity to your code. This post describes an alternative method where a mini-ViewModel is applied directly to the problem areas in the view,...

Colin Eberhardt

News on Silverlight adoption from the Silverlight 3 UK Launch

Yesterday myself and Gary Scott (our MD) went down to London for the Silverlight 3 UK launch event. This is the first time I have been to Microsoft's London office so I wasn't quite sure what to expect. The glass-clad arched office exterior, and shiny minimalist interior were certainly stylish,...

Colin Eberhardt

Silverlight v3 ClearType Font Rendering - A comparison

Text rendering has been a problem for both Silverlight and WPF for a while. This blog post looks at ClearType in Silverlight v3 and compares it to WPF and WinForms text rendering. Text clarity is something that concerns me quite a bit. In financial applications, often large quantities of both...

Colin Eberhardt

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

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...

Colin Eberhardt

Silverlight MultiBindings, How to attached multiple bindings to a single property.

This blog posts describes a technique for associating multiple bindings with a single dependency property within Silverlight applications. WPF already has this functionality in the form of MultiBindings, the code in this post emulates this function. UPDATE: Silverlight 4, attached properties and multiple property bindings are all supported in my...

Colin Eberhardt

Exposing Bindings as Properties of a Control

I must admit that the title of this post is not entirely clear, however I couldn't find a way to sum up the content in one short sentence, so we'll dive straight into an example. Let's say for example you have developed a funky little business-card as illustrated above, using...

Colin Eberhardt

Dependency Property Performance and Lissajous Figures

A few night ago I was working on a Siverlight control which renders some quite complex Paths, the geometry of which is determined from a number of dependency properties. In order to gain UI coolness points I wanted to animate the dependency properties in order to see a smooth transition...

Colin Eberhardt

New codeproject article on WPF, Silverlight + T4 Templates

I have just finished a new article on CodeProject - Generate WPF and Silverlight Dependency Properties using T4 Templates

Colin Eberhardt

Binding a Silverlight DataGrid to dynamic data via IDictionary

This post demonstrates a technique for binding a Silverlight DataGrid to dynamic data, the structure of which is not know at compile-time ... UPDATE #1: I have extended this technique to add include change notification so that the DataGrid can be made editable. Read all about it in part two....

Colin Eberhardt

Silverlight Dependency Property Code Generation

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...

Colin Eberhardt

Silverlight 3 is here! (but is it a flash killer yet?)

Less than 24 hours ago Microsoft's MIX09 conference kicked of in Las Vegas with Silverlight 3 taking centre stage. For those of you who have followed the conference build-up, this comes as no surprise, with twice as many Silverlight sessions (31) advertised than any other technology (WPF has a measly...

Colin Eberhardt

Using CSS Selectors for Styling in WPF

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...

Colin Eberhardt

Implementing RelativeSource binding in Silverlight

In my previous post I demonstrated how an the WPF ElementName style binding can be emulated with Silverlight via an attached behaviour. As a brief recap, the technique involved creating an attached property, which when bound, adds a handler for the elements Loaded event. When the element is loaded, the...

Colin Eberhardt

ElementName binding in Silverlight via Attached Behaviours

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...

Colin Eberhardt

Styling hard-to-reach elements in control templates with attached behaviours

OK, the title of this blog post is not very snappy, but it is not an easy problem to describe in a few short words. Here's the rub, the WPF DataGrid has a select-all button located in the top-left corner, just like Excel and many other grid controls / applications....

Colin Eberhardt

Adding a Location Crosshair to Silverlight Charts

UPDATE - The March09 update of the Silverlight toolkit is incompatible with the code detailed below. For an up-to-date version see the following blog post. This blog post describes how to add a location crosshair to your Silverlight charts as shown below: The chart itself is rendered using the charting...

Colin Eberhardt

BindingGroups for Total View Validation

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 bound business...

Colin Eberhardt

WPF DataGrid - Committing changes cell-by-cell

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 a...

Colin Eberhardt

WPF DataGrid - detecting the column, cell and row that has been clicked

The WPF DataGrid is a very flexible tool, however in its current state certain simple tasks can prove to be rather tricky. A fairly common task when working with DataGrid is detecting which row, or cell a user has clicked on, or whether they clicked a column header. You might...

Colin Eberhardt

Using BindingGroups for greater control over input validation

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....

Colin Eberhardt

Multiselect DataGrid with CheckBoxes

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 are associated...