XML
<telerik:RadButton
Name="btn_Reset"
Grid.Column="1"
Margin="2"
FontSize="15">
<Grid Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="1.3*" />
<RowDefinition />
</Grid.RowDefinitions>
<Path
Width="20"
Height="20"
Margin="1"
Data="{StaticResource ResetFlowGeometry}"
Fill="{telerik:VisualStudio2019Resource ResourceKey=IconBrush}"
Stretch="Uniform" />
<ContentPresenter Grid.Row="1" Content="复位" />
</Grid>
</telerik:RadButton>
path可以换成image就可以显示图片了。
此种方法只是简单替换 Button
的内容为 Image
,未涉及模板(ControlTemplate或DataTemplate)
在需要保持第三方原有样式时候非常好用
如果Path不显示,试一下: Stretch="Uniform"