private void OpenCommandsButton_Click(object sender, RoutedEventArgs e) { if (!_isCommandBarVisible || _isCommandBarCompact) { ShowFullCommandBarStoryboard.Begin(); } else { HideCommandBarStoryboard.Begin(); } if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent(nameof(AppBarButton), nameof(AppBarButton.LabelPosition))) { lightThemeButton.LabelPosition = CommandBarLabelPosition.Default; sepiaThemeButton.LabelPosition = CommandBarLabelPosition.Default; darkThemeButton.LabelPosition = CommandBarLabelPosition.Default; blackThemeButton.LabelPosition = CommandBarLabelPosition.Default; } }
private async void HtmlViewer_ScriptNotifyAsync(object sender, NotifyEventArgs e) { if (e.Value == "finishedReading") { if (!_isCommandBarVisible) { ShowMinimalCommandBarStoryboard.Begin(); } } else { var notify = e.Value.Split("|"[0]); switch (notify[0]) { case "S": double newReadingProgress = double.Parse(notify[1], NumberStyles.AllowDecimalPoint, NumberFormatInfo.InvariantInfo); ViewModel.SetReadingProgress(newReadingProgress); if (_isCommandBarCompact && newReadingProgress < 99) { _isCommandBarCompact = false; HideCommandBarStoryboard.Begin(); } break; case "RC": case "LC": int x = int.Parse(notify[2]); int y = int.Parse(notify[3]); try { ViewModel.RightClickUri = new Uri(notify[1]); ShowRightClickContextMenu(x, y); } catch { } break; case "video-app": case "video-browser": string provider = notify[1]; string videoId = notify[2]; var launcherOptions = new LauncherOptions(); if (notify[0] == "video-app") { launcherOptions = new LauncherOptions() { FallbackUri = GetVideoUri(provider, videoId, true) } } ; await Launcher.LaunchUriAsync(GetVideoUri(provider, videoId), launcherOptions); break; default: break; } } }