WP7 – Tombstoning simplified, less duplication

James Ashley posted a great tip on simplifying tombstoning by abstracting IsolatedStorageSettings.ApplicationSettings and PhoneApplicationService.Current.State to a common interface IDataStorage.  This makes storing either temporary state data or more permanent settings data much easier with less code. This was a very good post but the duplication on the two IDataStorage implementations made me cringe a little.  …

WP7 – Tombstoning simplified, less duplication Read More »

Unit Testing the Setting of MediaElementState in Silverlight

I recently had the need to change the state of a MediaElement to coincide with other page functionality.  You can easily change the state of a MediaElement from the code-behind but you can’t unit test this.  At first I thought, it would be easy to just bind the CurrentState property to a ViewModel property but …

Unit Testing the Setting of MediaElementState in Silverlight Read More »

Cast between Different Interface Implementations

Just finished a cool extension method (at least I think it is), that converts any interface implementation to another implementation.  This can’t be done normally.  Only properties are copied over but you could copy anything that can be accessed via reflection.  I know someone somewhere has already done this but its so rewarding to have …

Cast between Different Interface Implementations Read More »

WP7 MediaElement Memory Leak

Currently trying to fix a memory leak.  Don’t have a lot of experience troubleshooting these so figured I would post about.  The memory leak occurs when you replay a MediaElement in the MediaEnded event. I started with a new WP7 app added the following xaml to the page: <MediaElement AutoPlay=”True” Source=”MyShortMovie.wmv” MediaEnded=”MediaElement_MediaEnded”/> and the following …

WP7 MediaElement Memory Leak Read More »