how i can set background on string path?
canvas1.Background = "/path/";
please help!!! thanks :)
how i can set background on string path?
canvas1.Background = "/path/";
please help!!! thanks :)
I think you are looking for the ImageBrush class:
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = new BitmapImage(new Uri(@"/path/", UriKind.Relative));
canvas1.Background = imageBrush;
Use this
mycanvas.Background = new ImageBrush()
{ ImageSource = new BitmapImage((new Uri(mypath, UriKind.Absolute))) };