Пример #1
0
 private void OnClose()
 {
     if (selectorView != null)
     {
         selectorView.Close     -= SelectorView_Close;
         selectorView.Visibility = Visibility.Collapsed;
         SettingsContainer.Children.Remove(selectorView);
         SettingsContainer.Visibility            = Visibility.Collapsed;
         MediaPlayer.InteractiveDeactivationMode = deactivationMode;
         selectorView = null;
     }
 }
Пример #2
0
 void MediaPlayer_AudioSelectionInvoked(object sender, RoutedEventArgs e)
 {
     if (MediaPlayer.AvailableAudioStreams.Any())
     {
         selectorView = new AudioSelectionView();
         if (AudioSelectionViewStyle != null)
         {
             selectorView.Style = AudioSelectionViewStyle;
         }
         selectorView.SetBinding(FrameworkElement.DataContextProperty, new Binding()
         {
             Path = new PropertyPath("InteractiveViewModel"), Source = MediaPlayer
         });
         SettingsContainer.Visibility = Visibility.Visible;
         SettingsContainer.Children.Add(selectorView);
         selectorView.Close += SelectorView_Close;
         deactivationMode    = MediaPlayer.InteractiveDeactivationMode;
         MediaPlayer.InteractiveDeactivationMode = InteractionType.None;
     }
 }