/// <inheritdoc /> protected override void OnDeactivate() { #if SILVERLIGHT && !WINDOWS_PHONE bufferingElement.ClearValue(BufferingView.ViewModelProperty); #else MediaPlayer.InteractiveViewModelChanged -= MediaPlayer_InteractiveViewModelChanged; bufferingView.ViewModel = null; #endif bufferingContainer.Children.Remove(bufferingView); bufferingView = null; bufferingContainer = null; }
/// <inheritdoc /> protected override bool OnActivate() { bufferingContainer = MediaPlayer.Containers.OfType<Panel>().FirstOrDefault(e => e.Name == MediaPlayerTemplateParts.BufferingContainer); if (bufferingContainer != null) { bufferingView = new BufferingView(); if (BufferingViewStyle != null) bufferingView.Style = BufferingViewStyle; bufferingContainer.Children.Add(bufferingView); #if SILVERLIGHT && !WINDOWS_PHONE bufferingElement.SetBinding(BufferingView.ViewModelProperty, new Binding() { Path = new PropertyPath("InteractiveViewModel"), Source = MediaPlayer }); #else MediaPlayer.InteractiveViewModelChanged += MediaPlayer_InteractiveViewModelChanged; bufferingView.ViewModel = MediaPlayer.InteractiveViewModel; #endif return true; } return false; }
/// <inheritdoc /> protected override bool OnActivate() { bufferingContainer = MediaPlayer.Containers.OfType <Panel>().FirstOrDefault(e => e.Name == MediaPlayerTemplateParts.BufferingContainer); if (bufferingContainer != null) { bufferingView = new BufferingView(); if (BufferingViewStyle != null) { bufferingView.Style = BufferingViewStyle; } bufferingContainer.Children.Add(bufferingView); #if SILVERLIGHT && !WINDOWS_PHONE bufferingElement.SetBinding(BufferingView.ViewModelProperty, new Binding() { Path = new PropertyPath("InteractiveViewModel"), Source = MediaPlayer }); #else MediaPlayer.InteractiveViewModelChanged += MediaPlayer_InteractiveViewModelChanged; bufferingView.ViewModel = MediaPlayer.InteractiveViewModel; #endif return(true); } return(false); }