private void BtnAbortQueueItemClick(object sender, RoutedEventArgs e) { Button sendingbutton = (Button)sender; Video sendingElement = DmUploader.SearchForVideoInQueue((string)sendingbutton.Tag); if (sendingElement != null) { DmUploader.AbortVideo(sendingElement); } }