public async Task DeleteAsync(IType type, TaskContext context) { var authentication = context.Authentication; if (context.AllowException == false) { if (await VerifyAsync() == false) { return; } } await type.DeleteAsync(authentication); context.Pop(type); async Task <bool> VerifyAsync() { if ((await type.GetTablesAsync(item => true)).Any() == true) { return(false); } return(await type.Dispatcher.InvokeAsync(() => { if (type.TypeState != TypeState.None) { return false; } return true; })); } }