private void DeleteQuiz_Click(object sender, RoutedEventArgs e) { if (_selectedFile != null) { if (_contentManager.GetComponent(_imagesCache[_selectedFile.Name]).GetType().Name == "Quiz") { _contentManager.DeleteQuiz(_imagesCache[_selectedFile.Name], (comboBox.SelectedItem as Lesson).ID); _imagesCache.Remove(_selectedFile.Name); Files.Children.Remove(_selectedFile); _selectedFile = null; _saved = false; Save.IsEnabled = true; } } }