Resize a WPF window, but maintain proportions?

Posted by rathkopf on Stack Overflow See other posts from Stack Overflow or by rathkopf
Published on 2010-03-18T17:08:51Z Indexed on 2010/03/18 17:11 UTC
Read the original article Hit count: 400

Filed under:
|
|
|

I have a user resizable WPF Window that I want to constrain the resizing so the aspect ratio of the window stays constant.

Ideally I would like to constrain mouse location when the window is being resized by dragging a corner to positions that maintain the proper aspect ration. If an edge is resized with the mouse, the other dimension should change at the same time.

Is there a simple way to do this or a good on-line example that anyone knows of?

If no better solutions come up, I'll post what I've done after I've refined it a bit.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Windows