想给控件设置个圆形图片,代码如下:
<Setter Property="Icon">
<Setter.Value>
<Image Source="/WpfApp1;component/Resource/1.ico" Width="16" Height="16"/>
</Setter.Value>
</Setter>
报错,提示 expected type is ‘geometry’, actual type is ‘image’
改成如下:
<Setter Property="Icon">
<Setter.Value>
<EllipseGeometry Center="40,50" RadiusX="20" RadiusY="20"></EllipseGeometry>
</Setter.Value>
</Setter>