如何使用 XAML 样式裁剪视图?

How to Clip a View using XAML Style?

我的代码中有好几次这段代码

<Image
    Aspect="AspectFit"
    HeightRequest="75"
    WidthRequest="75">
    <Image.Clip>
        <EllipseGeometry
            Center="37.5,37.5"
            RadiusX="37.5"
            RadiusY="37.5" />
    </Image.Clip>
</Image>

我想将其提取为 XAML 样式以重用和减少代码

看起来像这样

<Style TargetType="Image" ApplyToDerivedTypes="True" x:Key="roundedImageStyle">
        <Setter Property="HeightRequest" Value="75"/>
        <Setter Property="WidthRequest" Value="75"/>
        <Setter Property="Aspect" Value="AspectFit"/>
        <Setter Property="Clip" Value="??????"/>
</Style>

如何在样式中设置Clip

@jfversluis 告诉我可以这样实现

<Setter Property="Clip">
    <EllipseGeometry
         Center="37.5,37.5"
         RadiusX="37.5"
         RadiusY="37.5" />
</Setter>