title: How checked file exist in Silverlight
body: <p>I need converter if image not exist or null return <code>new BitmapImage(new Uri("http://upload.wikimedia.org/wikipedia/commons/1/1c/No-Symbol.png"))</code>
  else if file exist return file.</p>
  
  <p>pathImage - example <code>http://localhost:65051/ClientBin/images/sm_butter_cake.jpg</code></p>
  
  <p>File.Exists - always returns false. Why?</p>
  
  <pre><code>public class ConvertNullImage : IValueConverter
      {
          public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
          {
              try
              {
                  string pathImage = Application.Current.Host.Source.AbsoluteUri.Substring(0, 
                      Application.Current.Host.Source.AbsoluteUri.LastIndexOf("/"));
                  if (File.Exists(pathImage + value.ToString()))
                  {
                      var image = new BitmapImage(new Uri(value.ToString(), UriKind.Relative));
                      return image;
                  }
                  else
                  {
                      throw new Exception("Not file");
                  }
  
              }
              catch { return new BitmapImage(new Uri("http://upload.wikimedia.org/wikipedia/commons/1/1c/No-Symbol.png")); }
          }
  
          public object ConvertBack(object value, Type targetType, object parameter,
                                    CultureInfo culture)
          {
              throw new NotImplementedException();
          }
      }
  </code></pre>