有一些代码:
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="Blue"></Rectangle>
<TextBlock Text="test"></TextBlock>
</StackPanel>
</DataTemplate>
我希望能够设置任何类型的形状,而不是矩形,例如椭圆。
想要类似的东西:
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Shape Fill="Blue" ShapeType={Binding DefaultShapeType}></Shape>
<TextBlock Text="test"></TextBlock>
</StackPanel>
</DataTemplate>