It's really strange problem which I hope somebody knows how to solve. Situation:
Our WPF project has a form on which we show context menus (ContextMenu control) and popups (Popup control) in response on some user actions. In most cases it happens on mouse click on some text block. Here is an example:
popup = new Popup { Placement = PlacementMode.Relative, PlacementTarget = textBlock, StaysOpen = false }; . . . . . //later on mouse click: popup.IsOpen = true;
The popup must appear aligned to the top-left corner of its placement target (some text block in our example) and so - overlap it. And it works just well in all cases except Windows 10 machines which have tablet mode (like MS Surface Pro). In such environments our popups appear to the left side of the placement targets and so - do not overlap them.
As we discovered it happens because of the special Windows 10 option described in this article: http://www.isunshare.com/windows-10/show-context-menu-on-left-or-right-in-windows-10.html
This option is set to "Right-handed" by default (which is understandable) but I don't understand why it influences in such way on Popup control and why it happens even in Desktop mode.
It would be great to find a way to change this default behavior and make our Popup appear aligned to top-left corner of parent control in any case. Does anybody know how to do it?