I want to adjust the corner radius on my buttons. I can do this by creating a separate style resource and setting the corner radius of a border in the template. However, I have to create a separate style for every variation.
What I want is an actual CornerRadius property that I can set for each button and not have to create another style every time I want a different corner radius.
Is my only solution here to create a custom control?
After some playing around I have concluded the easiest way to do this is bind to an attached property of type ConerRadius.
In the template you bind the Corner Radius like this:
You use it like this:
or even like this:
Examples:
Full code follows:
Attached property class:
Sample page using it:
Note: the button template is included inline in full for this example
Old answer
You have several options: