I have some code here and wish to know where to place an await. I have tried lamba => and the normal method but have come to no success.
private async void ContextMenuAbroad(object sender, RightTappedRoutedEventArgs args)
{
CheckBox ckbx = null;
if (sender is CheckBox)
{
ckbx = sender as CheckBox;
}
if (null == ckbx)
{
return;
}
string nameOfGroup = ckbx.Content.ToString();
var contextMenu = new PopupMenu();
contextMenu.Commands.Add(new UICommand("Edit this Group", (contextMenuCmd) =>
{
Frame.Navigate(typeof(LocationGroupCreator), nameOfGroup );
}));
contextMenu.Commands.Add(new UICommand("Delete this Group", (contextMenuCmd) =>
{
SQLiteUtils rfd = new SQLiteUtils();
rfd.DeleteGroupAsync(nameOfGroup );
}));
await contextMenu.ShowAsync(args.GetPosition(this));
}
I added an await, however I require to add an async somewhere... but where?
Resharpers inspection complained about: "Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call"
Any help is greatly appreciated!