title: How to make a File Exists Converter in WinRT
body: <p>I'm trying to check with a converter if a Image Source exists in local storage. If not go with the external url.</p>
  
  <p><code>&lt;Image Source="{Binding Image,  Converter={StaticResource ImageCacheConverter}}"/&gt;</code></p>
  
  <p>This is my converter so far:</p>
  
  <pre><code>public object Convert(object value, Type targetType, object parameter, string language)
  {
      return IfFileExist((string)value, "localimage.png");
  }
  public async Task&lt;string&gt; IfFileExist(string value, string filename)
  {
      var folder = ApplicationData.Current.LocalFolder;
      var getFilesAsync = await folder.GetFilesAsync(CommonFileQuery.OrderByName);
  
      var file = getFilesAsync.FirstOrDefault(x =&gt; x.Name == filename);
      if (file != null)
      {
          return "ms-appdata:///local/" + filename;
      }
      return (string)value;
  }
  </code></pre>
  
  <p>The major problem I'm facing is having async inside an IValueConverter. But i need the return o the IfFileExist to change the image source.</p>
  
  <p>Thanks in Advance.</p>