Windows phone 8.1 (Windows phone 8.1)在Windows phone 8.1上创建圆形图像按钮

Windows phone 8.1 (Windows phone 8.1)在Windows phone 8.1上创建圆形图像按钮,windows-phone-8.1,imagebutton,Windows Phone 8.1,Imagebutton,我想在WindowsPhone8.1中创建一个圆角半径为20.0的图像按钮,但我找不到任何解决方案,有人能给我建议一种方法吗 按钮如下所示: 您可以使用边框元素 <Border BorderBrush="Red" BorderThickness="2" CornerRadius="20" HorizontalAlignment="Left" > <Button BorderThickness="0" Click="Button_Click" >

我想在WindowsPhone8.1中创建一个圆角半径为20.0的图像按钮,但我找不到任何解决方案,有人能给我建议一种方法吗

按钮如下所示:


您可以使用边框元素

<Border BorderBrush="Red" BorderThickness="2" CornerRadius="20"  HorizontalAlignment="Left" >
    <Button  BorderThickness="0" Click="Button_Click"  >
            <Button.Background>
                <ImageBrush ImageSource="Assets/cart.png" Stretch="Uniform"/>
            </Button.Background>
    </Button>
    </Border>

试试这个

<Button  HorizontalAlignment="Left" Margin="47,636,0,0" >
    <Button.Template>
        <ControlTemplate>
            <Border BorderBrush="#6BA92A" Background="#6BA92A" CornerRadius="20,20,20,20" BorderThickness="2">
                <Button   Content="Add to cart"
                          Background="{TemplateBinding Background}"
                          Height="65"
                          Width="348"
                          FontSize="{TemplateBinding FontSize}"
                          BorderBrush="#6BA92A">
                </Button>
            </Border>
        </ControlTemplate>
    </Button.Template>
</Button>

我已经解决了这个问题,下面是我的代码:

<Rectangle Grid.Row="3" Margin="20,0,20,20" HorizontalAlignment="Stretch" Height="50" RadiusX="10" RadiusY="10" > <Rectangle.Fill>
<ImageBrush Stretch="Fill"  ImageSource="/Assets/images/add_cart_btn_bg.png"/>
 </Rectangle.Fill> </Rectangle>