How to set background image in Windows Phone 8?

后端 未结 2 607
予麋鹿
予麋鹿 2021-02-14 22:04

I am very new to WP apps and don\'t know how to set the back-ground image in app.xaml file for whole application in Windows Phone 8<

2条回答
  •  一向
    一向 (楼主)
    2021-02-14 22:34

    I use the following in the InitializePhoneApplication method of my app.xaml.cs. The effect is that every page has the same background image, and there's no flashing/blanking upon page navigation

     RootFrame = new PhoneApplicationFrame
     {
        Background = new ImageBrush()
        {
           ImageSource = new BitmapImage(new Uri("Assets/Russel_Logo_ep2s.png", UriKind.Relative)),
           Opacity = 0.3,
           Stretch = System.Windows.Media.Stretch.None,
           AlignmentX = AlignmentX.Center,
           AlignmentY = AlignmentY.Center
        }
     };
    

提交回复
热议问题