private static bool Created;
private static System.Threading.Mutex PaintGuard = new System.Threading.Mutex(false, "MonkeysUncleBob", out Created);
//Function that is attached to each pages "LayoutUpdated" call.
private async void AnyPageLayoutUpdated(object sender, object e)
catch (Exception f)
await is not compatible with
Mutex. You can use an async-compatible mutex like
SemaphoreSlim or the
AsyncLock that I have as part of my AsyncEx library.
However, if you need a named mutex, then you'll have to do something quite different. What that is depends on what exactly you're trying to do.