Reputation: 79
I have an image in my resources and I want to provide it as background of my button in windows phone. How to do that? I tried this , but giving an error
<Button Content="" HorizontalAlignment="Left" BorderBrush="Transparent" Margin="131,681,0,0" Name="button2" Width="81" Grid.Row="1" Click="button2_Click" Height="64" VerticalAlignment="Top" Background="Images/pause.png"/>
Upvotes: 4
Views: 68
Reputation: 39006
Try this,
<Button Content="" HorizontalAlignment="Left" Margin="114,36,0,0" Grid.Row="1" VerticalAlignment="Top">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Images/pause.png"/>
</Button.Background>
</Button>
Upvotes: 4