Use System.Windows Geometry types, rather than those from System.Drawing


The UIAutomation api uses System.Windows geometry types (For example, AutomationElementInformation.BoundingRectangle returns a System.Windows.Rect). For consistency then, methods like Mouse.MoveTo (contained in the tellingly-named assembly WpfUtilities) should surely be using System.Windows.Point rather than System.Drawing.Point?
Closed Feb 10, 2011 at 10:02 PM by ivom
Peter is right. The goal was to provide a "lowest common denominator" solution and that on Windows turned out to be classic Win32 screen coordinates. Otherwise, we would have introduced a dependency on WPF structures, which are not necessarily present on some machines.


antalp wrote Jun 10, 2009 at 5:47 AM

A good point (pun not intended). If I recall correctly, the challenge here is that the API currently provides DPI agnostic behaviors which aligns to the Winforms style Point, whereas DPI aware input may be open to interpretation.

I'll forward this issue on to the team so the feature owner can assess this issue and respond.

wrote Feb 10, 2011 at 10:02 PM

wrote Feb 14, 2013 at 9:08 PM

wrote May 16, 2013 at 11:02 AM