C# 将图像添加到单选按钮

C# 将图像添加到单选按钮,c#,wpf,xaml,C#,Wpf,Xaml,这是我的wpf窗口中可用的代码。如何将图像添加到MVVM中的这些单选按钮。这会将图片添加到单选按钮的背景中 <StackPanel Name="StpAddDel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5"> <RadioButton Name="rdbactive" Content="Active" GroupName="actinact" VerticalAlignment="

这是我的wpf窗口中可用的代码。如何将图像添加到MVVM中的这些单选按钮。

这会将图片添加到单选按钮的背景中

  <StackPanel Name="StpAddDel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
    <RadioButton Name="rdbactive" Content="Active" GroupName="actinact" VerticalAlignment="Center" Margin="5,0" Width="50" Height="15" Foreground="Blue"/>
    <RadioButton Name="rdbinactive" Content="InActive" GroupName="actinact" VerticalAlignment="Center" Margin="5,0" Width="60" Height="15" Foreground="Blue"/>
    <Button Name="BtnAdd"  Height="20" Width="20" Margin="5,0" Template="{StaticResource AddImgBtnTemplate}" />
    <Button Name="BtnDel" Height="20" Width="20" Margin="5,0" Template="{StaticResource DelImgBtnTemplate}" />
  </StackPanel>

这会将图片添加到单选按钮的背景中

  <StackPanel Name="StpAddDel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
    <RadioButton Name="rdbactive" Content="Active" GroupName="actinact" VerticalAlignment="Center" Margin="5,0" Width="50" Height="15" Foreground="Blue"/>
    <RadioButton Name="rdbinactive" Content="InActive" GroupName="actinact" VerticalAlignment="Center" Margin="5,0" Width="60" Height="15" Foreground="Blue"/>
    <Button Name="BtnAdd"  Height="20" Width="20" Margin="5,0" Template="{StaticResource AddImgBtnTemplate}" />
    <Button Name="BtnDel" Height="20" Width="20" Margin="5,0" Template="{StaticResource DelImgBtnTemplate}" />
  </StackPanel>

什么图像?(MVVM)需要绑定哪一块?你这样做有什么问题?你能展示一个你想要它是什么样子的屏幕截图吗?MVVM与此无关,因为这是100%的视图相关。@sparta93这是HTML+CSS,这是WPF和Xaml假设例如按钮,我们在同一方式中添加一些图像我的用户想在收音机中添加一些图像button@almulo哎呀,这是什么图像?(MVVM)需要绑定哪一块?你这样做有什么问题?你能展示一个你想要它是什么样子的屏幕截图吗?MVVM与此无关,因为这是100%的视图相关。@sparta93这是HTML+CSS,这是WPF和Xaml假设例如按钮,我们在同一方式中添加一些图像我的用户想在收音机中添加一些图像button@almulo哎呀,嗨,斯巴达,你能回答我下面的问题吗?嗨,斯巴达,你能回答我下面的问题吗