I have a dockpanel which contains an array of Label (Rectangles) inherited from Border class, which contains CornerRadius property. So, everything is good, but when I start resizing the window, or add the labels to the dockpanel, their size narrows and the Corner remains the same as it was with the bigger label size!! For example, I have a big size label 300*300 with CornerRadius 30. It looks good, but when I resize the window (make it much smaller) it turns into circle.
I tried to implement the special coefficient but nothing helps. Maybe i have made mistake.
Borderis “keeping” it’s corner radius regardless of it’s actual size. And that’s usually a good thing.In your case, I’d use a
Path(NOTE: not aRectangle).Using Expression Blend, you can draw a
Rectangleof a certain size, set it’sRadiusXandRadiusYproperties and then make a path out of it (there’s an option in the menus, under ‘Tools’, IIRC). The path will scale (and warp) it’s corner radius.Having said that, what do you need this functionality for? Maybe ViewBox will do the job without inheritance?