views:

26

answers:

1

I have a custom styled transparent window and i've seen a lot of issues handling min/max/resize behavior when you use transparency and "WindowStyle=None".

When I tell my window to change it's windowstate to maximized it doesn't get it right so I want to override the logic there. It gets the width right but the height is all messed up and it doesn't know to add padding to account for a outerglow effect.

Without using win32 functions is there a SOMEWHAT EASY way for me to determine the "max viewport" or "max bounds" of the display that the application is running on top of? I think the short answer to this question is probably no but I figured I would ask anyways. I have my min/max width and height set up for the application and I figured if there was some function I could call to bring me back a x/y max bound then I could just set the window height and width to those values after I subtract the padding. My intention is to have supported resolution from 1024x768 - 1920x1080 so that this application can be displayed multiple places without reconfiguration.

+1  A: 

Take a look at the Screen.PrimaryScreen Property. It has a method called GetWorkingArea which I think is what you want.

If there is more than one display, then there are methods to enumerate through the displays and find out which display the application is on.

ChrisF
ah, this is in the system.windows.forms namespace. I've been told that carrying a reference to that libary in my wpf project is a no no because of performance drawbacks. Have you had first hand experience with using this?
TWood
@TWood - I've not used it extensively or in a time critical area, but it does work OK.
ChrisF