Hi,
I just started learning SL. I have tried to resize all the elements inside the canvas on its resize. But i cant find the right way.
this is what i did
- Iterate throgh the all child elements in canvas
- calaculate the scale X & Y based on the new size
- And multiply the scale values with each elements size properties
But in SL3.0 i dont find any size properties in UIelement to set the new size. below the sample code
private void testCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
{
var scaleX = e.NewSize.Width / e.PreviousSize.Width;
var scaleY = e.NewSize.Height / e.PreviousSize.Height;
for (int i = 0; i < testCanvas.Children.Count; i++)
{
UIElement ui = testCanvas.Children[i];
// but no ui.width or ui.height
}
}
Also i cant able to find an option to move each element to the new position relative to the size changed canvas...
can someone point me the right direction..
Update:
I wanted to achieve something like this in MSCUI .. For more clarity i have added some screenshots
This is how initial screen looks.
And on expanding widget, it gets zoomed and other widgets shrink
I only need to do the zooing part. any ideas??
Cheers
RameshVel