public async Task DeleteAsync(ITableCategory category, TaskContext context) { var authentication = context.Authentication; if (context.AllowException == false) { if (await VerifyAsync() == true) { return; } } await category.DeleteAsync(authentication); context.Pop(category); async Task <bool> VerifyAsync() { if ((await category.GetAllTablesAsync(item => true)).Any() == true) { return(false); } return(await category.Dispatcher.InvokeAsync(() => { if (category.Parent == null) { return false; } return true; })); } }