Content

6/09/2011

MVVM Light for Windows Phone EventToCommand Memory Leak

When you use EventToCommand like this, be careful!

<Button>
  <i:EventTrigger EventName="Click">
     <mvvmLight:EventToCommand Command="{Binding MyCommand "/>
  </i:EventTrigger>
</Button>

The memory usage will be growing up.
The Attach of the DependencyObject is working fine, but the detach will never called. That causes severe memory issues.
It's a known issue on codeplex:
http://mvvmlight.codeplex.com/workitem/7293
http://mvvmlight.codeplex.com/workitem/7512

We tried to find good ways to detach our event handler. But to remove the EventToCommand stuff was much easier than any workaround we found.

Windows Phone 7.1 "Mango" new application profiler beta 1 throws ArgumentNullException parameter s:

The cool new Windows Phone 7.1 update called "Mango" is released and I wanted to try the new cool profiler for my current App.
The first big thing was to get it running for the new release.
You have to update all your used libraries to the new 7.1 version.

I started to profil my app wich caused a crash.
It took me several hours to figure out the problem.

The issue is that the PropertyChanged event throws a ArgumentNullException with parameter s:
I have still no solution for it and I am just waiting at Microsoft to get a hotfix for it.