So I touched on this earlier when I when over the JavaScript class structure for Silverlight classes. So usually when I get a comp from a designer they are usually designed for a certain size say 400 by 600. say there is some element in the block is 45 pixels accross. So now I make my class out put all these bits into the xaml on the fly so the functionality is better contained in a class for reuse. I want me UI to be able to be set to different sizes and have it look correct. Todo that I need to calculate the relative width. So at a width of 400 for the UI and the element is at a width of 45 needs to be reset when the width changes to 240. So what I want todo is take the width and multiply it times some value that gives me the correct number to replace the 45. So what I do is divide 45 by 400 to find the factor I need to be able to take the width whether its 400, 500 or just 180 and then multiply it by the factor. So in code I might have something like this:
var ItemWidth = UIWidth * .1125;
and poof a got my width and my UI can be set to anything size I want and it looks correct.