XAML page for Silverlight background image pattern

Asked By 100 points N/A Posted on -
qa-featured

I would like to setup a background image pattern that repeats in all the XAML page for Silverlight. Please help me.

SHARE
Best Answer by Angeliname smith
Answered By 0 points N/A #90801

XAML page for Silverlight background image pattern

qa-featured

 

Try to work just  the following:

Uri uri = new Uri("images/main.jpg", UriKind.Relative);

ImageSource imgSource = new BitmapImage(uri);

imgMain.Source = imgSource;

 Your problem should be solved by the way hopefully. Best wishes for you.

Best Answer
Best Answer
Answered By 0 points N/A #90802

XAML page for Silverlight background image pattern

qa-featured

Hi Olivia,

Try this one.

// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
    ImageBrush brush = new ImageBrush
    {
        ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri("/Images/AppBackground.jpg", UriKind.Relative)),
        Opacity = 0.5d
    };
    this.RootFrame.Background = brush;
}

I hope this will fix your problem.

 

Thanks.

Login/Register to Answer

Related Questions