コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        /// <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);
        }