I have what I hope is a simple question, but we will see. I am creating a silverlight application which has many buttons that I would like to be the same length. I am not sure about how the easy way to go about this. But what I have in mind:
Is it possible to create a variable:
int width = 200
Then set the width property for every button equal to the variable 'width'? This way if I need to change the width of the buttons I can do it in one spot, instead of individually. I know how to do this in C#, I was just wondering if it is possible to do in XAML?
Thanks,
roaster
February 26th, 2010, 03:22 PM
mariocatch
Re: Dynamic width
In your Container's Resources, do the following:
Note: Container can be a Page, Window, Grid, StackPanel, even a Button... Any level of the hierarchy contains a Resources collection.