private void UploadAudioButtonClick(object sender, RoutedEventArgs e) { try { var id = int.Parse(((Button)sender).CommandParameter.ToString()); var uploadAudio = new UploadAudio(id); uploadAudio.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }