T9 encoding, decoding and prediction in C# 26 October 2010 Diederik-Krols WPF T9 stands for Text on 9 keys. It's the -patented- mobile phone technology that allows words in SMS messages to be entered by a single keypress for each letter. So instead of pressing the '3'-key three times to enter an 'f', you press the key only once. The software will then try to figure out whethe... [More]
Essential WPF ListBox Styling 12 October 2010 Diederik-Krols WPF This article explains how to style a WPF ListBox. I know: there must be a million articles about this subject. So if you're looking for kaleidoscopic brushes, dazzling effects, and animations from outer space, then feel free to press the Back button in your browser to return to your search engine pa... [More]
A Rich HTML TextBlock for WPF 31 August 2010 Diederik-Krols WPF This article -proudly- presents a WPF control that displays rich text from an HTML source: it has a Text dependency property that you can bind to a HTML-formatted string. It's designed to display -not edit- rich information messages like warnings, error messages, and other feedback e.g. from a local... [More]
Getting and setting the Transaction Isolation Level on a SQL Entity Connection 30 August 2010 Diederik-Krols Entity Framework 4.0, SQL Server This article explains how to get, set, and reset the transaction isolation level on a SQL and Entity connection. In a previous article I already explained how important it is to explicitly set the appropriate isolation level when using transactions. I'm sure you're not going to wrap each and every d... [More]
Get your WCF client configuration from anywhere 30 July 2010 Diederik-Krols An application that consumes one or more WCF services needs to provide the address, binding protocol, and contract (ABC) of each end point in its app.config file. This article shows an easy way to let the application get its WCF client configuration data from anywhere: a flat file, a database, even ... [More]
Transactions and Connections in Entity Framework 4.0 29 June 2010 Diederik-Krols Entity Framework 4.0, SQL Server This article describes where, why, and how to use TransactionScope in the Entity Framework 4.0. The proposed best practices apply to a medium to large data access layer, e.g. a DAL that is implemented as one or more WCF services with lots of internal calls. Allow me to start with the conclusions: ... [More]
Optimistic concurrency using a SQL DateTime in Entity Framework 4.0 31 May 2010 Diederik-Krols .NET 4.0, Entity Framework 4.0, SQL Server, WPF This article explains how to implement optimistic concurrency checking using a SQL Server DateTime or DateTime2 column. It's a follow-up of my previous article on using a TimeStamp column for that same purpose. In most -if not all- concurrency checking cases it actually makes more sense to use a Dat... [More]
Self-Tracking Entities with Validation and Tracking State Change Notification 18 May 2010 Diederik-Krols .NET 4.0, WPF, Entity Framework 4.0 This article explains how to extend Self-Tracking Entities (STE) from Entity Framework (EF) 4.0 with validation logic and (tracking) state change notification, with just minimal impact on the T4 files. We'll build a two-tier application that submits local changes in a WPF application via a WCF servi... [More]
Optimistic concurrency using a SQL Timestamp in Entity Framework 4.0 04 May 2010 Diederik-Krols .NET 4.0, WPF, Entity Framework 4.0 This article explains how to implement optimistic concurrency checking in the Entity Framework 4.0, using a SQL Server Timestamp column. But you could have derived that from its title. What is a Timestamp? Despite its name, the SQL Server Timestamp data type has nothing to do with time. DateTime2 ... [More]
WPF 4.0 and Windows 7: get more Functionality per Square Inch 03 May 2010 Diederik-Krols .NET 4.0, WPF The Windows 7 taskbar comes with nice features like a thumbnail preview with clickable thumb buttons, a progress bar in the taskbar item, and jump list items and task items in its context menu. Access to the shell integration API from the managed world is done through the System.Windows.Sh... [More]