title: Handling WPF button double-click in MVVM pattern
body: <p>I have a button in an MVVM application that is hooked up to a command in the view model. The handler for the view model command does some file I/O (particularly calling File.Copy to create or overwrite an existing file).</p>
  
  <p>Now, it seems that when I double-click on the button, this command handler gets called twice. Since both handlers are now trying to access the same file to copy/overwrite it at the same time, I'm getting an IOException.</p>
  
  <p>Is there anyway to deal with this situation short of catching the IOException and ignoring it? This does not seem to be a guaranteed catch although there may be unrelated problems with the rest of the system that causes that to happen.</p>