WPF: Why is it VisualTreeHelper.GetDrawing(Visual v) and not Visual.GetDrawing()?
Just curious -开发者_JS百科- prima facie it seems more awkward and less discoverable, but is there a good reason?
I believe it is intentionally obfuscated a bit, because you shouldn't be directly fiddling with the visual tree most of the time, fitting with the "Framework Design Guidelines" philosophy of "Commonly used classes should follow basic scenarios".
Since any method in Visual would be on pretty much any WPF control, they chose to put these advanced methods in a separate class. What the Framework designers are subtly trying to tell you is, "You shouldn't use this function unless you really know there's no better way to do what you're doing".
精彩评论