title: Change Background Image when Theme has been changed
body: <p>I'm trying to change the ImageSource of an ImageBrush when the user changes the theme of his phone in his settings.</p>
  
  <p>So currently I have this:</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;ImageBrush ImageSource="{Binding ImageSource, Mode=OneTime}" Stretch="UniformToFill"/&gt;
  </code></pre>
  
  <p>CodeBehind:</p>
  
  <pre><code>public string ImageSource
  {
      get
      {
          if ((Visibility)App.Current.Resources["PhoneDarkThemeVisibility"]
              == Visibility.Visible)
          {
              return "/Images/BGDark.png";
  
          }
          else
          {
              return "/Images/BG.png";
  
          }
      }
      private set { }
  }
  </code></pre>
  
  <p>As you can see, I'm setting the Background when the application has been started. The app will set the Background by seeing which Theme has been selected.</p>
  
  <p>My problem is now that when the user goes to settings (application hasn't been closed!) and changes the theme, the Background/ImageSource won't be updated, when he activates the app pagain.
  I've thought that maybe I could change it by setting the new Background here:</p>
  
  <p>App.xaml.cs:</p>
  
  <pre><code>private void Application_Activated(object sender, ActivatedEventArgs e)
  {
      //access somehow the CodeBehind of my MainPage and change the ImageSource
  }
  </code></pre>
  
  <p>But I don't know how I would access the property...
  Is there maybe another solution to change the background while the app is still running and the user changes the theme?</p>