title: How to delete files using xamarin forms
body: <p>I tried to delete file from specific directory(Folder) but it doesn't work for me</p>
  
  <p>this is my code</p>
  
  <pre><code>DeletePhoto.Clicked += async (sender, args) =&gt;
              {
                  var file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
                  {
                      PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,
  
                  });
  
  
                  if ( file != null)
                  {
                      if (File.Exists(file.Path))
                      {
                          DependencyService.Get&lt;IFileManager&gt;().DeleteFile(file.Path);
                      }
                      file.Dispose();
  
                  }
              };
  </code></pre>
  
  <p>In android</p>
  
  <pre><code>  public class FileManager : IFileManager
          {
              public void DeleteFile(string source)
              {
                  File.Delete(source);
              }
          }
  </code></pre>
  
  <p>IFileManager Interface</p>
  
  <pre><code> public interface IFileManager
      {
          void DeleteFile(string source);
      }
  </code></pre>
  
  <p>In mainfest permisson is given but something didn't happen and i find the file which i deleted</p>