/// <summary> /// Sets the window's fullscreen state. /// </summary> /// <param name="fullScreen">True for fullscreen, false otherwise.</param> public void SetFullScreen(bool fullScreen = true) { if (fullScreen == IsFullScreen) { return; } if (fullScreen && !IsFullScreen) { oldState = Player.windowData.Window.WindowState; oldStyle = Player.windowData.Window.WindowStyle; } Player.windowData.Window.ResizeMode = fullScreen ? ResizeMode.NoResize : ResizeMode.CanResize; Player.windowData.Window.ShowTitleBar = !fullScreen; Player.windowData.Window.ShowCloseButton = !fullScreen; Player.windowData.Window.WindowStyle = fullScreen ? WindowStyle.None : oldStyle; Player.windowData.Window.WindowState = fullScreen ? WindowState.Maximized : oldState; IsFullScreen = fullScreen; OnFullscreenChanged?.Invoke(this, new OnFullscreenChangedEventArgs(IsFullScreen)); }
public void OnFullscreenChangedCallback() { OnFullscreenChanged.InvokeAsync(null); }