How to set background image on Windows Phone 7 App

If you want to add a custom image as a background of you windows phone app page, you can with this few lines of code.

Put this code in your loading method.

var app = Application.Current as App;
var imageBrush = new ImageBrush
{
ImageSource = new BitmapImage(new Uri(imageName, UriKind.Relative))
};
app.RootFrame.Background = imageBrush;

Leave a Reply

Your email address will not be published. Required fields are marked *