private async void RemoveRecording_Click(object sender, RoutedEventArgs e) { var result = await DialogHelper.DisplayConfirmCancelDialog("Are you sure?", "Are you sure that you want to permanently delete the selected element?"); if (result == ContentDialogResult.Primary) { string path = (sender as Button).Tag.ToString(); rh.RemoveRecord(path); RecordingsList.Remove(RecordingsList.Where(x => x.FilePath == path).First()); } }