I just moved my PC to Windows 8 from Windows 7 and while running our WPF application I noticed that our WPF popups and/or tool tips are now in the lower-left by default instead of the normal lower right. Has anyone noticed this? I know you can specify their location on each tooltip in the xaml, but we have a lot of tool tips and popups. I want to know if there is a way to specify the default location globally in a WPF app. Google hasn't yielded many results on this subject. We have a reason to keep them in the same original default position (some popups have content relative to their start up position).
Windows 8: (Lower left)
Windows 7: (Lower right)
Same code! Standard "tooltip" xaml attribute.
Any ideas?
RESOLVED AND I POSTED THE COMMENTS
Ok, I have found the issue. It has to do with Tablet PCs/Touchscreens. (left handed.. right handed preference) This other link provided a reason. I am working on a solution to resolve this now. Ill post up the details soon!
If you cannot use solutions that alter this behavior system-wide, here's how I do it for a single popup:
Thanks @TravisWhidden for the solution. Just implemented an improved version of it that listens to the StaticPropertyChanged event, I'll paste it in here because it seems less of a "hack".
Ok, for those that do not want this to occur at all in their app (which was our desire), We have created a nice little hack for WPF. This works well for us.
First:
This code will be what runs which fixes the issue:
However, the environment can de-validate microsofts internal cache of these values, so we have to hook into WinProc to get this. I wont post the WinProc code, just the messages that are needed:
These are the Win32 messages that will de-validate the internal cache:
And the quick snippit that will set your preference back. Because we are hooked into WinProc, you will want to change this value after WinProc is finished with the message on other handlers. We have a delay to re-set the preference value back to what we want.
And just like that its complete. I hope this helps someone else!