title: a sharing violation occurred while accessing with paint
body: <p>i have a image. and i open it in image viewer that i created. now i want to edit this image. so i open this image in paint and when i click on save button after change it give me. some error of a sharing violation occurred while accessing.</p>
  
  <p>i remove the file name from image viewer before open image in paint.</p>
  
  <p>here is my code..</p>
  
  <pre><code>private void btnEditImage_Click(object sender, RoutedEventArgs e)
          {
              if (File.Exists(Helper.DefaultPath + listImages[count].Path))
              {
                  SetNullImage();
                  string editPath = Helper.DefaultPath + listImages[count].Path;
                  if (File.Exists(editPath))
                  {
                      Process my = new Process();
                      my.StartInfo.FileName = "mspaint.exe";
                      my.StartInfo.Arguments = "\"" + editPath + "\"";
                      my.StartInfo.CreateNoWindow = true;
                      my.EnableRaisingEvents = true;
                      my.Exited += new EventHandler(myProcess_Exited);
                      my.Start();
                  }
              }
          }
          private void myProcess_Exited(object sender, System.EventArgs e)
          {
              Dispatcher.Invoke(new Action(() =&gt;
              {
                  SetImage();
              }));
          }
  </code></pre>
  
  <p>See Images</p>
  
  <p>Open In Image viewer:
  <a href="https://i.stack.imgur.com/HDKoM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HDKoM.jpg" alt="Open In Image viewer"></a></p>
  
  <p>thanks...</p>
  
  <p>Error when make changes in image and click on save:
  <a href="https://i.stack.imgur.com/mXNIP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mXNIP.png" alt="Error when make changes in image and click on save"></a></p>