I'm trying to set a backgroundpicture for my button in my code behind. The picture is available as a png in the resources.
Button sampleBody = new Button();
ImageBrush imageBrush = new ImageBrush((ImageSource)Properties.Resources.MyPic);
imageBrush.Stretch = Stretch.Fill;
sampleBody.Background = imageBrush;
The above code isn't working (obviously) but that's what I'm trying todo in a nutshell.
Thanks in advance for any tips.