Patch for Issue 12865
https://wpf.codeplex.com/workitem/12865
Merge pull request #4 from sennl/master

Patch for Issue 12865