Pages

Friday, 7 September 2012

Enforcing square proportions in XAML


Enforcing square proportions in XAML In my current Windows 8 project, I needed an object on the screen to resize with screen size – and keep it’s proportions. Turned out to be a bit trickier than I thought…

What I wanted was this:

I had to have it as Stretch alignment to scale with the screen size, so fixed Width/Height was out of the question. The starting point was to have VerticalAlignment=Stretch to always use a third of the screen height, but what about the Width?

Read More

No comments:

Post a Comment

Web Informer Button