I have defined a Mutex in my class (global):
static Mutex fooMutex; And I want to lock something so that the user is not allowed to see the effect of tapping the image more then once per 3 seconds:
private void Image_Tap_1(...) { bool isRunnng = true; try { Mutex.OpenExisting("foo"); } catch { isRunnng = false; fooMutex = new Mutex(true, "foo"); } if (!isRunnng) { fooFadeIn.Begin(); fooFadeIn.Completed += fooFadeIn_Completed; } And dispose on Completed:
private void fooFadeIn_Completed(...) { fooMutex.Dispose() But this does not work, anyone got an idea?