WPF Memory Dump Analyzer

Saturday, June 15, 2013

After I published my post on debugging dependency properties with WinDbg, I figured out that the process that I described can be easily automated, which in turn, can be a great opportunity to take the new ClrMD library for a test drive. Thanks to ClrMD, I managed to come up pretty quick with a fairly reasonable POC. In this post, I want to introduce you to the result of that test drive: WPF Memory Dump Analyzer. WPF Memory Dump Analyzer is a tool that scans a memory dump of a WPF application for all the dependency objects on...
one comment

Debugging Dependency Properties with WinDbg

Saturday, June 1, 2013

Dependency properties are one of the corner stones of the WPF framework. They were designed to support various features like change notification, multiple value providers, validation, value inheritance and more. On the other hand, their implementation makes them less intuitive to debug with WinDbg. Unlike regular CLR properties, getting their value is more than just dumping the object in which they are declared. In this post I would like to explain and demonstrate how WinDbg can play nicely with dependency properties. Overview Before we launch WinDbg, I want to explain how dependency properties are implemented under the...
no comments

Blend Behaviors + DependencyPropertyDescriptor = Memory Leak

Thursday, March 14, 2013

In the past couple of weeks, I was taking part in a focused effort to find and fix memory-related issues in one of my client's applications. In this post I want to write about a specific type of memory leak that I found more than once, which is related to Blend-behaviors. As an example, consider the following behavior: 1: public class MyMarginDependentBehavior : Behavior<FrameworkElement> 2: { 3: private readonly DependencyPropertyDescriptor...
no comments

Setting a WPF Window to be Always on Top

Saturday, January 5, 2013

Some applications require that their main window will always be on top of all the other windows. Doing so in WPF is quite simple. In this post I will show how. In order for the window to be opened on top of all the other windows, set its Topmost property to True. Doing just that is not enough, because when the window will lose its focus, it will be placed behind the focused window. To keep the window top-most even after it loses its focus, add an EventTrigger to the window's LostFocus event, and set the Topmost property...
tags: , , ,
no comments

WPF Command Confirmation

Thursday, October 25, 2012

In the last post, I introduced you to my DynamicGridFormationBehavior, which gives you the ability to dynamically change a grid's formation, using only Xaml. In this post, I want to introduce you to another behavior, called ConfirmationBehavior. First let's set the context. Assume that we have an application that handles customers' information, and allows CRUD operations on it. The client asked that before any critical operation on the data (deleting a customer for example), a confirmation message will appear. If you're following the MVVM pattern in your WPF applications (and you should), you will probably end up...
tags: , , ,
no comments

Changing WPF Grid Structure Dynamically

Friday, October 19, 2012

In an application I was working on recently, I needed to implement a split screen, like those on the closed-circuit cameras monitors. Usually, a simple Grid or a UniformGrid would do the trick, but in this case, the requirement was to allow the user to dynamically change the grid's structure. The following screenshots shows the grid's structure when the user chooses to display two, three, or four screens, respectively: As you can see, different user selections requires entirely different grid structure, with different number of...
tags: , , ,
no comments