基本圖形:
Rectangle及Ellipse
此樣本為了測試RadiusX,RadiusY這兩個屬性的具體含義
<UserControl x:Class="ShapeDemo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel>
<Rectangle RadiusX="25" RadiusY="5" Width="100" Height="100" Stroke="Red" StrokeThickness="1" ToolTipService.ToolTip="紅色長方形=寬:100 高:100 圓角X軸半徑:25 圓角Y軸半徑:5"></Rectangle>
<Ellipse Width="50" Height="50" Stroke="Green" StrokeThickness="1" Margin="-50,-150,0,0" ToolTipService.ToolTip="綠色圓形=寬:50 高:50 "></Ellipse>
<Ellipse Width="50" Height="10" Stroke="Black" StrokeThickness="1" Margin="-50,-190,0,0" ToolTipService.ToolTip="黑色橢圓形=寬:50 高:10 "></Ellipse>
<Rectangle RadiusX="25" RadiusY="25" Width="100" Height="100" Stroke="Purple" StrokeThickness="1" ToolTipService.ToolTip="紫色長方形=寬:100 高:100 圓角X軸半徑:25 圓角Y軸半徑:25"></Rectangle>
<Ellipse Width="50" Height="50" Stroke="Blue" StrokeThickness="1" Margin="-50,-150,0,0" ToolTipService.ToolTip="藍色圓形=寬:50 高:50 "></Ellipse>
<Ellipse Width="50" Height="10" Stroke="Yellow" StrokeThickness="1" Margin="-50,-190,0,0" ToolTipService.ToolTip="黃色橢圓形=寬:50 高:10 "></Ellipse>
</StackPanel>
</Grid>
</UserControl>
測試結果