/// <summary> /// 导航到VideoDetail页面时执行 /// </summary> /// <param name="navigationContext"></param> public override void OnNavigatedTo(NavigationContext navigationContext) { base.OnNavigatedTo(navigationContext); isOnNavigatedTo = true; // 屏蔽顶部弹幕 AllowStatus danmakuTopFilter = SettingsManager.GetInstance().GetDanmakuTopFilter(); TopFilter = danmakuTopFilter == AllowStatus.YES; // 屏蔽底部弹幕 AllowStatus danmakuBottomFilter = SettingsManager.GetInstance().GetDanmakuBottomFilter(); BottomFilter = danmakuBottomFilter == AllowStatus.YES; // 屏蔽滚动弹幕 AllowStatus danmakuScrollFilter = SettingsManager.GetInstance().GetDanmakuScrollFilter(); ScrollFilter = danmakuScrollFilter == AllowStatus.YES; // 分辨率-宽 ScreenWidth = SettingsManager.GetInstance().GetDanmakuScreenWidth(); // 分辨率-高 ScreenHeight = SettingsManager.GetInstance().GetDanmakuScreenHeight(); // 弹幕字体 string danmakuFont = SettingsManager.GetInstance().GetDanmakuFontName(); if (danmakuFont != null && Fonts.Contains(danmakuFont)) { // 只有系统中存在当前设置的字体,才能显示 SelectedFont = danmakuFont; } // 弹幕字体大小 FontSize = SettingsManager.GetInstance().GetDanmakuFontSize(); // 弹幕限制行数 LineCount = SettingsManager.GetInstance().GetDanmakuLineCount(); // 弹幕布局算法 DanmakuLayoutAlgorithm layoutAlgorithm = SettingsManager.GetInstance().GetDanmakuLayoutAlgorithm(); SetLayoutAlgorithm(layoutAlgorithm); isOnNavigatedTo = false; }
/// <summary> /// 设置弹幕同步算法 /// </summary> /// <param name="layoutAlgorithm"></param> private void SetLayoutAlgorithm(DanmakuLayoutAlgorithm layoutAlgorithm) { switch (layoutAlgorithm) { case DanmakuLayoutAlgorithm.SYNC: Sync = true; Async = false; break; case DanmakuLayoutAlgorithm.ASYNC: Sync = false; Async = true; break; case DanmakuLayoutAlgorithm.NONE: Sync = false; Async = false; break; default: break; } }
/// <summary> /// 设置弹幕布局算法 /// </summary> /// <param name="danmakuLayoutAlgorithm"></param> /// <returns></returns> public bool SetDanmakuLayoutAlgorithm(DanmakuLayoutAlgorithm danmakuLayoutAlgorithm) { settingsEntity.DanmakuLayoutAlgorithm = danmakuLayoutAlgorithm; return(SetEntity()); }
/// <summary> /// 设置弹幕布局算法 /// </summary> /// <param name="danmakuLayoutAlgorithm"></param> /// <returns></returns> public bool SetDanmakuLayoutAlgorithm(DanmakuLayoutAlgorithm danmakuLayoutAlgorithm) { appSettings.Danmaku.DanmakuLayoutAlgorithm = danmakuLayoutAlgorithm; return(SetSettings()); }