Handle Race Conditions / Concurrency in Code First Entity Framework Applications

Preface A common scenario in developing applications is the handling of concurrent database updates. Given there is an application to manage customers, that is used by multiple users simultaneous. User U1 reads the data of customer C1. While user U1 is looking at this data, user U2 reads the data …

Create a 1:1 Table Relationship using Entity Framework

Preface My database roots are pure SQL. When I create a database, I use an Excel sheet for documentation purposes, which creates SQL statements to build up the tables. Table relationships (parent / child) with foreign keys I do define by hand, like the good old craftsmen do. It’s simple …

“Device Not Functioning” Exception on Invalid PrimaryLanguageOverride Value in Windows Store Apps

Oh, what a title for a post. The correct title is “‘A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)’ Exception Occurs When Showing A TextBox and ApplicationLanguages.PrimaryLanguageOverride Is Set To An Invalid Value in Windows Store Apps on Windows 8.1“. Symptom Building the Factory Commander, …

IsTabStop Changes ListView ‘s Focusable Behaviour in Windows Store Apps

The Issue Using the Factory Commander, I noticed some strange behavior. I opened a folder with more items than can be displayed on the screen on the left side. Then I scrolled to the last item of the list and switched to the right list. There, I moved up or …

Position the PopupMenu for Drag And Drop Operations in Windows Store Apps

Preface Sometimes it is helpful to open a PopupMenu when the user drops items on a destination, e.g. to ask the user if the items should be copied or moved. I’d like to open the PopupMenu exactly where the user released the mouse / finger, means put the upper left …

Considerations Regarding Building a FileSystemWatcher for Windows Store Apps

Preface Unfortunately, .NET for Windows Store apps does not provide a FileSystemWatcher class. Nevertheless, one might want get notified when a folder, or file in a folder, has been changed. This post presents some points I found worth to consider when I implemented a FileSystemWatcher for Windows Store apps. Because …

VisualTreeHelper Extensions for Windows Store Apps

Preface The VisualTreeHelper “provides utility methods that can be used to traverse object relationships (along child-object or parent-object axes) in the visual tree of your app.” In this post I will show two extensions to VisualTreeHelper. Since you cannot create an instance of VisualTreeHelper, these are not extension methods from …

Discover Properties of Storage Items in Windows Store Apps

Preface Sometimes it is helpful to discover some or all properties of storage items (StorageFile, StorageFolder). These classes implement the interfaces IStorageItem and IStorageItemProperties. IStorgeItem.GetBasicPropertiesAsync gets an object that provides access to the basic properties of an item. IStorageItemProperties.Properties gets an object that provides access to the content-related properties of …

MessageBox for Windows Store Apps in C# / XAML

Preface The replacement of MessageBox for Windows Store apps is the class MessageDialog. This class is fine as long as you do not need more than three options the user can choose from. In technical words, MessageDialog allows only up to three commands. At the time of writing, this is …