title: Serialize and Store an Image in an XML File
body: <p>Got a little bit of a problem. I have a program that builds an observable collection of Users. The User has a Firstname, Lastname, and Image. I can add the user to the observable collection, but I also want to save the collection and load it everytime I reopen the program. </p>
  
  <p>My problem is that while its fairly easy to save a firstname and lastname, the writer can't write the image to the xml file. Is there any way around this?</p>
  
  <p>Here's what I have so far:</p>
  
  <p>the observable collection:</p>
  
  <pre><code>ObservableCollection&lt;VendorClass&gt; ProfileList = new ObservableCollection&lt;VendorClass&gt;();
  </code></pre>
  
  <p>the problematic writer:</p>
  
  <pre><code>XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection&lt;VendorClass&gt;));
          using (StreamWriter wr = new StreamWriter("vendors.xml")) //Data/customers.xml
          {
              xs.Serialize(wr, ProfileList);
          }
  </code></pre>
  
  <p>Any ideas? And if there does exist a solution to write in an image, is there a viable way to read it out again?</p>