Tuesday, March 5, 2013

More resizing "fun"

Turns out that the project I am currently on has controls with a SizeChanged event already coded into them. 

Our developer noticed this when the app kept refreshing layout over and over and over and over again. So, the solution for these pages was to use MeasureOverride

protected override Size MeasureOverride(Size availableSize)
{
     this.LayoutRoot.Height = availableSize.Height;
     this.LayoutRoot.Width = availableSize.Width;
     return base.MeasureOverride(availablesSize);
}

Here is a link with some more information on how this operates. Luckily - I didn't need to have any other code with this one on those pages.

No comments:

Post a Comment