public async Task <bool> ChangeFullScreenStateAsync(FullScreenChangeType changeType) { if ((changeType == FullScreenChangeType.Enter && IsFullScreenMode) || (changeType == FullScreenChangeType.Exit && !IsFullScreenMode)) { return(true); } if (changeType == FullScreenChangeType.Toggle) { changeType = IsFullScreenMode ? FullScreenChangeType.Exit : FullScreenChangeType.Enter; } var result = false; switch (changeType) { case FullScreenChangeType.Enter: result = AppView.TryEnterFullScreenMode(); break; case FullScreenChangeType.Exit: AppView.ExitFullScreenMode(); result = true; break; default: throw new Exception("this should never happen"); } await Task.Delay(100); return(result); }
public bool ChangeFullScreenState(FullScreenChangeType changeType) { if ((changeType == FullScreenChangeType.Enter && IsFullScreenMode) || (changeType == FullScreenChangeType.Exit && !IsFullScreenMode)) { return(true); } if (changeType == FullScreenChangeType.Toggle) { changeType = IsFullScreenMode ? FullScreenChangeType.Exit : FullScreenChangeType.Enter; } switch (changeType) { case FullScreenChangeType.Enter: return(AppView.TryEnterFullScreenMode()); case FullScreenChangeType.Exit: AppView.ExitFullScreenMode(); return(true); } throw new Exception("this should never happen"); }