title: Capture and save a photo in XAML/C# for a Windows store application
body: <p>I'm trying to take and save a photo using a windows surface device.</p>
  
  <p>I'm using the code below to take a photo and this work but I'd like to automatically create a directory on the device's local drive and save this photo there without any dialog prompts.</p>
  
  <p>So the code I use to capture to photo is as follows:</p>
  
  <pre><code>CameraCaptureUI camera = new CameraCaptureUI();
  
  StorageFile file = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
  if (file!=null)
  {
      using (IRandomAccessStream ras=await file.OpenAsync(FileAccessMode.Read))
      {
          BitmapImage source = new BitmapImage();
          source.SetSource(ras);
  
          imageBuildingPhoto.Source = source; // this is just an image control.
      }
  }
  </code></pre>
  
  <p>So after this I'd like to automatically save the photo to a new directory. e.g.</p>
  
  <p>My Pictures\NewDirectory\Photo1.jpg</p>
  
  <p>Anybody got any idea how I can do this?</p>
  
  <p>This is a windows store application written using C#4.5 and XAML.</p>
  
  <p>Thanks in advance</p>