设置应用程序的背景图片:
private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            SetAppBackground("/ChangeBackground;component/Images/Lighthouse.png");
        }

        private static void SetAppBackground(string imageName)
        {
            var app = Application.Current as App;
            if (app == null)
                return;

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

        private void image2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            SetAppBackground("/ChangeBackground;component/Images/Tulips.jpg");
        }

 

 

windows phone 学习笔记 四   windows phone 学习笔记 四

相关文章:

  • 2021-12-31
  • 2021-09-05
  • 2021-07-29
  • 2021-08-02
  • 2021-12-18
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-08-18
  • 2022-02-11
  • 2021-09-27
  • 2022-02-27
相关资源
相似解决方案