Restyle your window

Until recently, creating a custom window style in Windows Presentation Foundation was quite a challenging task. You had to implement the window’s behavior from scratch. Resizing, moving and all other typically window related functionality had to be reinvented and reimplemented just because you wanted the window header bar to look different. You could also (and still can if you …

By Mirek on (tags: style, WindowChrome, WPF, categories: code)

Keep your culture consistent among threads.

Have you ever had a problem that your multithreaded application lost a culture context ? Have you found a good solution for this? I did. My application had to support different cultures. So I simply set the required culture on my application’s current thread like this Then I noticed that worker threads, that I am using somewhere during the application runtime, don’t know anythi…

By Mirek on (tags: CultureInfo, localization, thread, categories: code)

Want to learn Blend for Visual Studio?

This is definitely the best resource to start with then. Jerry Nixon together with Unni Ravindranathan created a Blend for Visual Studio tutorial. It is over six hours long video tutorial and is available for free here or in Microsoft Virtual Academy as a Jump start.…

By Mirek on (tags: Blend, categories: web)

WPF– visual states in MvvM

WPF has many rich features which facilitates making a great look&feel of the application. Unfortunately many of those features are cumbersome to implement and use when we develop in a Model - View – ViewModel architecture. In this post I will try to make you more familiar with visual states and how can we use them in our MvvM application. Visual state simply defines a state…

By Mirek on (tags: behaviors, Expression Blend, Visual state, WPF, categories: code)

20 GB extra in SkyDrive for Windows Phone users

The Christmas just around the corner and the Microsoft bestows his users with gifts… Yeap, for those who have a Windows Phone and a SkyDrive account Microsoft has a nice Christmas gift. You will get extra 20 GB of SkyDrive space for free for one year. So if you are a regular SkyDrive user, you probably have now your 7GB of free (free of charge) space (which is, btw. still more …

By Mirek on (tags: SkyDrive, Windows Phone, categories: web)

FileTable performance test

In my last post I have described a workaround for using a FileTable in Entity Framework 6.0. In this post I would like to show you the results of performance test of storing big documents in sql FileTable. I have put in comparison storing 10 pdf documents 16MB each in database. First application is a Entity Framework Code First based app with mapped stored procedures. Those pro…

By Mirek on (tags: Entity Framework, FILETABLE, SQL, categories: architecture)

Using SQL FileTable in Entity Framework

FileTable is a great new feature in SQL Server 2012 which facilitates storing and working with unstructured blob data in SQL Server. Unfortunately is not yet supported in Entity Framework, so you cannot simply use FileTable in your entity model. But there is a workaround for this inconvenience, which I am going to show you in this post. FileTable is a fixed schema regular sql t…

By Mirek on (tags: Entity Framework, FILESTREAM, FILETABLE, SQL, categories: architecture, infrastructure, code)

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)