Handling already handled events in WPF

This is a simple trick to handle already handled routed events in WPF application. In WPF the routed events are passed down through the visual tree from the source of the event until they meet the element that can handle them. This behavior, called bubbling, is sometimes not what we expect. Imagine a situation when we have a grid and other child controls in it. We want to …

By Mirek on (tags: routed events, WPF, categories: code)

Entity Framework – lazy loading properties

In the Entity Framework we can easily enable lazy loading of navigation properties by marking them as virtual. This however applies only to properties that reference other related entity type. The framework does not support lazy loading of scalar or primitive properties. But there is a trick to fill this lack quite easily. Let’s assume we would like to lazy load some properties…

By Mirek on (tags: Entity Framework, lazy loading, shared primary key associations, table splitting, categories: architecture, code)

Mocking application settings

Last time I showed a simple way of using application settings in our wpf application. This time I would like to present you my way of testing Properties.Settings, or rather mocking it in our application tests. First of all we need to make our application code independent of the concrete implementation of auto generated Settings class. Let’s define an interface which will contai…

By Mirek on (tags: mocking, settings, testing, categories: code)

Keep your temp folder clean

Temporary folders in your system are used to store temporary files obviously. Unfortunately those temporary files, very often, stays there for ever and makes your hard drive wasted. Indeed many applications uses temp folder to store auxiliary files but do not clear it causing temp folder grow and grow. In this post I would like to present my short code snippet to keep temp fold…

By Mirek on (tags: Process, Task, Temp, categories: code)

angular with foreign (jQuery) promises

When using angular turns out that it’s not as straightforward when it comes to foreign libraries. I needed to use jQuery $.post instead of angulars $http.post method (to reduce the friction between angular and asp.net mvc regarding request token validation) and I came across unexpected (though understandable once you get to the core problem) behavior. Here’s the angular version…

By on (tags: angular, javascript, jQuery, categories: web)