Hi,
I dont know whether your design is suited the below impementation.Try the following.
create a data template as follows
<DataTemplate x:Key="MyButtonContentTemplate" DataType="{x:Type local:YourViewModelObject}">
<Grid>
<TextBlock x:Name="txt" Text="{Binding display_name}"/>
<Image x:Name="img" Source="{Binding image_source}"/>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding image_source}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="img"/>
</DataTrigger>
<DataTrigger Binding="{Binding display_name}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="txt"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
then set the content as your view model object and apply the content template as the above template.
<Button ContentTemplate="{StaticResource MyButtonContentTemplate}" x:Name="btn" Width="100" Height="50"/>
btn.Content = YourViewModelObject;