protected override void OnHohoemaNavigatingFrom(NavigatingFromEventArgs e, Dictionary <string, object> viewModelState, bool suspending) { if (suspending) { // viewModelState[nameof(CurrentSettingsKind)] = CurrentSettingsKind.Value.Kind.ToString(); } else { // Note: ページアンロード中にPivotのSelectedItemが操作されると // Xaml側で例外がスローされてしまうようなので // サスペンド処理時はCurrentSettingsContentを変更しない //CurrentSettingsContent.Value = null; } // フィルタ // NG VideoTitleを複数行NG動画タイトル文字列から再構成 _NGSettings.NGVideoTitleKeywords.Clear(); foreach (var ngKeyword in NGVideoTitleKeywords.Value.Split('\r')) { if (!string.IsNullOrWhiteSpace(ngKeyword)) { _NGSettings.NGVideoTitleKeywords.Add(new NGKeyword() { Keyword = ngKeyword }); } } _NGSettings.Save().ConfigureAwait(false); // TVMode有効フラグをXaml側に反映されるようリソースに書き込み // 汚いやり方かもしれない App.Current.Resources["IsTVModeEnabled"] = Helpers.DeviceTypeHelper.IsXbox || HohoemaApp.UserSettings.AppearanceSettings.IsForceTVModeEnable; _RankingSettings.GetFile().ContinueWith(async prevTask => { await HohoemaApp.PushToRoamingData(prevTask.Result); }); _NGSettings.GetFile().ContinueWith(async prevTask => { await HohoemaApp.PushToRoamingData(prevTask.Result); }); base.OnHohoemaNavigatingFrom(e, viewModelState, suspending); }
public override void OnLeave() { // NG Comments _NGSettings.NGCommentKeywords.Clear(); foreach (var ngKeyword in NGCommentKeywords.Value.Split('\r')) { if (!string.IsNullOrWhiteSpace(ngKeyword)) { _NGSettings.NGCommentKeywords.Add(new NGKeyword() { Keyword = ngKeyword }); } } _NGSettings.Save().ConfigureAwait(false); base.OnLeave(); }
protected override void OnLeave() { _NGSettings.Save().ConfigureAwait(false); _PlayerSettings.Save().ConfigureAwait(false); _PlaylistSettings.Save().ConfigureAwait(false); }