private void btnCancel_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this item?", "Delete item", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { DataChanged = false; this.Close(); } }
private void btnCancel_Click(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show( "Are you sure you want to cancel? All changes or potential additions could be lost.", "Sure?", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { this.Close(); } }
private async void btnDelete_Click(object sender, RoutedEventArgs e) { MessageBoxResult results = MessageBox.Show("Ae you sure you want to delete this item?", "Confirm deletion", MessageBoxButton.YesNo); if (results == MessageBoxResult.Yes) { var selected = (CovidResponses)lvResponses.SelectedItems[0]; await _context.DeleteItemAsync <CovidResponses>(selected.Id, new Microsoft.Azure.Cosmos.PartitionKey(selected.Date), _context.CovidResponsesContainer); await UpdateData(); } }