如何在角色的不同半径的XAML中制作矩形?

Ant*_*ton 1 silverlight xaml

如何在角色的不同半径的XAML中制作矩形?我需要仅使用"Rectangle"标签来创建它,因为宽度会动态变化,我不想玩很少的数字.

Exmple: 例

Mic*_*ter 9

使用带有CornerRadius的Border而不是Rectangle.

规格:

<Border CornerRadius="uniformRadius"/>
<Border CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>
Run Code Online (Sandbox Code Playgroud)

例:

<Border CornerRadius="10,0,0,10"/>
Run Code Online (Sandbox Code Playgroud)


key*_*rdP 6

您可以修改矩形的RadiusX和RadiusY属性.

编辑:刚看到你想要不同的角有不同的半径.要为每个角具有不同的曲率,请使用Border's CornerRadius属性.订单是Top Left, Top Right, Bottom Right, Bottom Left.

CornerRadius="25,25,0,0"
Run Code Online (Sandbox Code Playgroud)