private void AddFavoriteMovie(object sender, RoutedEventArgs e) { var selectedItem = SearchListBox.SelectedItem; if (selectedItem != null) { _userViewModel.AddFavoriteMovie(); LoadMovies(); } else { Window popup = new Window(); popup.Title = "Warning!"; popup.Width = 300; popup.Height = 150; popup.Content = "\n\n\n \t Select a movie!"; popup.ShowDialog(); } }