Geeks With Blogs


What I do:

Identity Mine

MVVM Light


What I am:

Microsoft Most Valuable Professional, Client Application Development

Microsoft Certified Technology Specialist, Windows Presentation Foundation

WPF disciples


View my profile on LinkedIn

Creative Commons License
Diary of a Code Trotter by Laurent Bugnion is licensed under a Creative Commons Attribution 3.0 Unported License

All source code on this blog is licensed under the MIT license.

Copyright (c) 2006 - 2011 GalaSoft Laurent Bugnion

Laurent Bugnion (GalaSoft) Diary of a Code Trotter

Update: I posted an updated version which doesn't use JavaScript. See here.

One of the first things I often do when I create a new Silverlight application is to make it self resizing. This is not very difficult, because thanks to the goodness of WPF (of which Silverlight is a subset), resizing a scene only involves one simple operation: a ScaleTransform. This transform applies to a panel (in this case the top Canvas) and to all its children. Using a ScaleTransform, all the distances (dimensions, but also coordinates) are multiplied by a factor, so you don't need to move anything when the panel is resized. Additionally, since XAML graphics are vector-based, they will resize very gracefully (of course, if your application uses pixel-based graphics such as BMPs, PNGs, movies, etc..., then you will see pixels if you make the application very big).

Read the rest of this entry ยป

Posted on Sunday, December 23, 2007 7:06 AM Technical stuff , .NET , Silverlight , .NET 3.5 | Back to top

Comments on this post: Silverlight 2.0: Project template for self-resizing applications

Comments are closed.
Comments have been closed on this topic.
Copyright © Laurent Bugnion | Powered by: