Patch for Issue 12865

Patch for issue 12865 reported on Codeplex.
Maybe the issue list from codepley should be migrated to GitHub so we could work on them here.

https://wpf.codeplex.com/workitem/12865