In a custom WPF control I would like to set the width of the control to be a function of the Height. For example: Width = Height / 3 * x;
What would be the best way to accomplish this so that the control resizes (and initially sizes) correctly and fluidly?
You could bind
WidthtoActualHeight, and use converter to apply custom function. E.g. the following code makes Button always squared:Hope this helps,
Cheers, Anvaka.