So I have a WPF application that maximizes window when it's dragged to the top of the screen.
However, I'd like to change a property, and because of that I think it would be best If I create my own drag maximize properties.
What's the easiest way to do that?
Thanks in advance.
You can check if the WindowState of your window is set to "Maximized". If it is maximized, you can change the text accordingly.
For this, you need to subscribe to the SizeChanged event of the window, and in the event handler, check if the WindowState is set to Maximized/Normal. If so, you can change the text accordingly.
I'm assuming that you're using a custom window trying to denote the minimize, restore and close buttons using buttons with font "Wingdings" or some such font which has glyphs to denote the icons for minimize, restore/maximize, and close.
Anyway, even if my assumption is wrong, you can always adapt the code below as per your situation.