public async Task CloseViewModelAsync(bool? result)
{
if (IsClosed)
{
return;
}
UninitializeThrottling();
IsClosing = true;
await OnClosingAsync();
ViewModelManager.UnregisterAllModels(this);
await CloseAsync();
SuspendValidation = true;
// Note: important to set *before* calling the event (the handler might need to check
// if the vm is closed)
IsClosing = false;
IsClosed = true;
await OnClosedAsync(result);
Log.Info("Closed view model '{0}'", GetType());
ViewModelManager.UnregisterViewModelInstance(this);
}
#endregion