我正在开发一个 XAML 项目,我想添加两个包含添加和删除图像的按钮。附上我要添加的按钮的屏幕截图。
问问题
69 次
1 回答
0
Button
带Image
里面的样品。
因为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 回答