Patch for Issue 12865

Patch for issue 12865 reported on Codeplex.
Maybe the issue list from codeplex should be migrated to GitHub.

https://wpf.codeplex.com/workitem/12865