-3

我正在开发一个 XAML 项目,我想添加两个包含添加和删除图像的按钮。附上我要添加的按钮的屏幕截图。

在此处输入图像描述

4

1 回答 1

0

ButtonImage里面的样品。

因为Button它本身没有Image属性,所以你应该将图像作为Content元素Button

        <Button x:Name="btnNewItem" Command="{Binding Path=NewItemCommand}" HorizontalAlignment="Left" Margin="10,10,0,0">
            <StackPanel Orientation="Horizontal">
                <Image Value="/Resources/Bitmaps/Add.png"/>
                <TextBlock VerticalAlignment="Center" Text="Button text" />
            </StackPanel>
        </Button>
于 2019-02-06T15:22:20.380 回答