Patch for Issue 12865
https://wpf.codeplex.com/workitem/12865