void Content_FullScreenChanged(object sender, EventArgs e) { if (!Application.Current.Host.Content.IsFullScreen) { if (this.FullPopup != null) { PlayTools playTools = (this.FullPopup.Child as VideoFullPlayer).CurrentPlayTools; playTools.IsScreenFull = false; this.LayoutRoot.Children.Add(playTools); Grid.SetRow(playTools, 1); this.FullPopup.IsOpen = false; this.FullPopup = null; } } }
void playTools_ClickFullScreenButton(bool isScreenFull) { Application.Current.Host.Content.IsFullScreen = isScreenFull; if (isScreenFull) { this.FullPopup = new Popup(); double width = Application.Current.Host.Content.ActualWidth; double height = Application.Current.Host.Content.ActualHeight; VideoFullPlayer videoFullPlayer = new VideoFullPlayer(); videoFullPlayer.FullScreenChange += new Action <bool>(videoFullPlayer_FullScreenChange); videoFullPlayer.Width = width; videoFullPlayer.Height = height; videoFullPlayer.SetVideoBrush(this.mediaElement); PlayTools playTools = this.playTools; this.LayoutRoot.Children.Remove(this.playTools); videoFullPlayer.CurrentPlayTools = playTools; FullPopup.Child = videoFullPlayer; FullPopup.IsOpen = true; } }