I have a WPF app using a custom Maximize/Restore button. In Windows 11, mouse hover on maximize/restore button does not pop up snap layout feature like below:
Does anyone have any idea fixing this issue? Kindly advise.
TIA!
I have a WPF app using a custom Maximize/Restore button. In Windows 11, mouse hover on maximize/restore button does not pop up snap layout feature like below:
Does anyone have any idea fixing this issue? Kindly advise.
TIA!
Copyright © 2021 Jogjafile Inc.

Here you can find an extensive discussion about this topic
https://github.com/dotnet/wpf/issues/4825
including some working code:
https://github.com/ghost1372/HandyControls/commit/41fce1df04b45ab9a7a8ebad33f3810a89a1ad13
However, in my opinion is too much processing for that snap menu which can be easily displayed by pressing Win + Z keys on your keyboard.
This is the solution that I came up with in XAML only. Instead of having a Border that holds the content of the button, I created a Path around the sign in the center. The area inside the sign will bring up the snap menu because it has no Fill set which means the mouse cursor will hit the WindowChrome over that area. Below is the style and the result. You get the idea. It is not perfect, but it is better than nothing.