private void problemBtn_Click(object sender, RoutedEventArgs e) { SingleVideo sv = _current.Questions[questionsListBox.SelectedIndex].Resolvers[resolversListBox.SelectedIndex].VisualContent as SingleVideo; problemBtn.Background = new SolidColorBrush(!sv.IsNormal ? Colors.DarkGreen : Colors.DarkRed); normalBtn.IsEnabled = false; }
private async void resolversListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (questionsListBox.SelectedIndex > -1 && resolversListBox.SelectedIndex > -1) { SingleVideo sv = _current.Questions[questionsListBox.SelectedIndex].Resolvers[resolversListBox.SelectedIndex].VisualContent as SingleVideo; if (sv != null) { media.Src = System.IO.Path.Combine(Environment.CurrentDirectory, _pk, sv.Src); } else { await this.ShowMessageAsync("Ошибка", "Для данного материала еще не назначен медиа-контент", MessageDialogStyle.Affirmative, new MetroDialogSettings() { AnimateShow = true, AnimateHide = true }); } } else { media.Src = null; } refreshControls(); }