private void HandleContentDialogPrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var selectedItem = AddComboBox.SelectedItem; if (selectedItem == null) { return; } PlaylistViewModel selectedPlaylist = DebugHelper.CastAndAssert <PlaylistViewModel>(selectedItem); selectedPlaylistId = selectedPlaylist.PlaylistId; selectedPlaylist.AddSong(Song); }