title: How ro store image locally once it was downloaded by Image control in Windows 8?
body: <p>My Windows Store (aka Windows 8) application uses the default Grid Application template to show the items. The item template there includes an image with overlaid text information. To diminish the size of application I do not store the images for every item, instead I save an Uri with absolute path (http) to the webserver where the image resides. I modified the standard template to bind to the image Uri (I had to convert the Uri to string for this to work properly) and now whenever I start the application all the images are downloaded and shown automatically by the Image control.</p>
  
  <p>What I now want is to automatically save the images which were once downloaded and modify the Uris of the downloaded images to those pointing to the local storage. Here I bump into two problems:</p>
  
  <ul>
  <li>I can't get the ImageOpened event to fire if I bind the complete ItemTemplate from the <code>StandardStyles.xaml</code></li>
  </ul>
  
  <p>This is the binding from my <code>GroupedItemsPage.xaml</code>:</p>
  
  <pre><code>    &lt;GridView
          x:Name="itemGridView"
          ItemTemplate="{StaticResource Standard250x250ItemTemplate}"&gt;
  </code></pre>
  
  <p>The bound template was modified to fire an event (<code>StandardStyles.xaml</code>):</p>
  
  <pre><code>&lt;DataTemplate x:Key="Standard250x250ItemTemplate"&gt;
              &lt;Image Source="{Binding ImageUri}" ImageOpened="Image_ImageOpened"/&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>The <code>Image_ImageOpened</code> event handler is defined in the code-behind file (`GroupedItemsPage.xaml.cs'), but never fires:</p>
  
  <pre><code>    private void Image_ImageOpened(object sender, RoutedEventArgs e)
      {
  
      }
  </code></pre>
  
  <ul>
  <li>I don't know how to store the content of the Image framework element as a binary file.</li>
  </ul>