title: How can I change image.source with C#?
body: <p>I'm developing a Windows Phone app.I have an image . This is its XAML code:</p>
  
  <pre><code>&lt;Image x:Name="imageclock" Grid.Row="1" 
          Source="Image/Myimage.png" Height="240" Width="240"
          /&gt;
  </code></pre>
  
  <p>And i want change image.source with this code:</p>
  
  <pre><code>private void ClickonBtn(object sender, EventArgs e)
      {
              BitmapImage bm = new BitmapImage(new Uri("Image/Darktheme.png", UriKind.RelativeOrAbsolute));
              imageclock.Source = bm;
      }
  </code></pre>
  
  <p>But when i complied, imageclock.Source=Null and this is error:</p>
  
  <blockquote>
    <p><em>An exception of type 'System.NullReferenceException' occurred in Newappver1.DLL but was not handled in user code</em></p>
  </blockquote>