public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <KeywordSearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Keyword;

            if (SearchOption == null)
            {
                throw new Exception("");
            }


            SelectedSearchSort.Value = VideoSearchOptionListItems.First(x => x.Sort == SearchOption.Sort && x.Order == SearchOption.Order);

            KeywordSearchBookmark = Database.BookmarkDb.Get(Database.BookmarkType.SearchWithKeyword, SearchOption.Keyword)
                                    ?? new Database.Bookmark()
            {
                BookmarkType = Database.BookmarkType.SearchWithKeyword,
                Label        = SearchOption.Keyword,
                Content      = SearchOption.Keyword
            };
            RaisePropertyChanged(nameof(KeywordSearchBookmark));

            SearchOptionText = Helpers.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);

            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);


            base.OnNavigatedTo(e, viewModelState);
        }
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <MylistSearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Mylist;

            if (SearchOption == null)
            {
                throw new Exception();
            }

            SelectedSearchSort.Value = MylistSearchOptionListItems.FirstOrDefault(x => x.Order == SearchOption.Order && x.Sort == SearchOption.Sort);

            SelectedSearchSort.Subscribe(async opt =>
            {
                SearchOption.Order = opt.Order;
                SearchOption.Sort  = opt.Sort;
                SearchOptionText   = Helpers.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);

                await ResetList();
            })
            .AddTo(_NavigatingCompositeDisposable);

            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);



            base.OnNavigatedTo(e, viewModelState);
        }
示例#3
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string && e.NavigationMode == NavigationMode.New)
            {
                SearchOption = PagePayloadBase.FromParameterString <LiveSearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Niconama;

            if (SearchOption == null)
            {
                var oldOption = viewModelState[nameof(SearchOption)] as string;
                SearchOption = PagePayloadBase.FromParameterString <LiveSearchPagePayloadContent>(oldOption);

                if (SearchOption == null)
                {
                    throw new Exception();
                }
            }

            _NowNavigatingTo         = true;
            SelectedSearchSort.Value = LiveSearchSortOptionListItems.FirstOrDefault(x => x.Sort == SearchOption.Sort && x.Order == SearchOption.Order);
            SelectedSearchMode.Value = LiveSearchModeOptionListItems.FirstOrDefault(x => x.Mode == SearchOption.Mode) ?? LiveSearchModeOptionListItems.First();
            SelectedProvider.Value   = LiveSearchProviderOptionListItems.FirstOrDefault(x => x.Provider == SearchOption.Provider);
            _NowNavigatingTo         = false;


            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);


            base.OnNavigatedTo(e, viewModelState);
        }
示例#4
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <TagSearchPagePayloadContent>(e.Parameter as string);
            }

            _NowProcessFavorite = true;

            IsFavoriteTag.Value             = false;
            CanChangeFavoriteTagState.Value = false;

            _NowProcessFavorite = false;

            if (SearchOption == null)
            {
                throw new Exception();
            }

            Models.Db.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);

            var target     = "タグ";
            var optionText = Util.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);

            UpdateTitle($"{SearchOption.Keyword} - {target}/{optionText}");

            base.OnNavigatedTo(e, viewModelState);
        }
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string && e.NavigationMode == NavigationMode.New)
            {
                SearchOption = PagePayloadBase.FromParameterString <TagSearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Tag;

            SelectedSearchSort.Value = VideoSearchOptionListItems.First(x => x.Sort == SearchOption.Sort && x.Order == SearchOption.Order);


            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);

            TagSearchBookmark = Database.BookmarkDb.Get(Database.BookmarkType.SearchWithTag, SearchOption.Keyword)
                                ?? new Database.Bookmark()
            {
                BookmarkType = Database.BookmarkType.SearchWithTag,
                Label        = SearchOption.Keyword,
                Content      = SearchOption.Keyword
            };

            FollowButtonService.SetFollowTarget(this);

            RaisePropertyChanged(nameof(TagSearchBookmark));



            base.OnNavigatedTo(e, viewModelState);
        }
示例#6
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <LiveSearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Niconama;

            if (SearchOption == null)
            {
                throw new Exception();
            }

            _NowNavigatingTo         = true;
            SelectedSearchSort.Value = LiveSearchSortOptionListItems.FirstOrDefault(x => x.Sort == SearchOption.Sort && x.Order == SearchOption.Order);
            SelectedSearchMode.Value = LiveSearchModeOptionListItems.FirstOrDefault(x => x.Mode == SearchOption.Mode) ?? LiveSearchModeOptionListItems.First();
            SelectedProvider.Value   = LiveSearchProviderOptionListItems.FirstOrDefault(x => x.Provider == SearchOption.Provider);
            _NowNavigatingTo         = false;

            var    optionText   = Helpers.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);
            var    providerText = SelectedProvider.Value.Label;
            string mode         = "";

            if (SearchOption.Mode.HasValue)
            {
                switch (SearchOption.Mode)
                {
                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.OnAir:
                    mode = "放送中";
                    break;

                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.Reserved:
                    mode = "放送予定";
                    break;

                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.Closed:
                    mode = "放送終了";
                    break;

                default:
                    break;
                }
            }
            else
            {
                mode = "すべて";
            }

            SearchOptionText = $"{optionText}/{mode}/{providerText}";

            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);


            base.OnNavigatedTo(e, viewModelState);
        }
示例#7
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <LiveSearchPagePayloadContent>(e.Parameter as string);
            }

            if (SearchOption == null)
            {
                throw new Exception();
            }

            Models.Db.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);

            var target     = "生放送";
            var optionText = Util.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);

            string mode = "";

            if (SearchOption.Mode.HasValue)
            {
                switch (SearchOption.Mode)
                {
                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.OnAir:
                    mode = "放送中";
                    break;

                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.Reserved:
                    mode = "放送予定";
                    break;

                case Mntone.Nico2.Searches.Live.NicoliveSearchMode.Closed:
                    mode = "放送終了";
                    break;

                default:
                    break;
                }
            }
            else
            {
                mode = "すべて";
            }

            UpdateTitle($"{SearchOption.Keyword} - {target}/{optionText}({mode})");

            base.OnNavigatedTo(e, viewModelState);
        }
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <CommunitySearchPagePayloadContent>(e.Parameter as string);
            }

            SelectedSearchTarget.Value = SearchOption?.SearchTarget ?? SearchTarget.Community;

            if (SearchOption == null)
            {
                throw new Exception("コミュニティ検索");
            }

            SelectedSearchSort.Value = CommunitySearchSortOptionListItems.FirstOrDefault(x => x.Order == SearchOption.Order && x.Sort == SearchOption.Sort);
            SelectedSearchMode.Value = CommunitySearchModeOptionListItems.FirstOrDefault(x => x.Mode == SearchOption.Mode);


            new[] {
                SelectedSearchSort.ToUnit(),
                    SelectedSearchMode.ToUnit()
            }
            .CombineLatest()
            .Subscribe(async _ =>
            {
                SearchOption.Sort  = SelectedSearchSort.Value.Sort;
                SearchOption.Order = SelectedSearchSort.Value.Order;
                SearchOption.Mode  = SelectedSearchMode.Value.Mode;

                await ResetList();

                RefreshSearchOptionText();
            })
            .AddTo(_NavigatingCompositeDisposable);

            Database.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);


            base.OnNavigatedTo(e, viewModelState);
        }
示例#9
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <MylistSearchPagePayloadContent>(e.Parameter as string);
            }

            if (SearchOption == null)
            {
                throw new Exception();
            }


            Models.Db.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);


            var target     = "マイリスト";
            var optionText = Util.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);

            UpdateTitle($"{SearchOption.Keyword} - {target}/{optionText}");

            base.OnNavigatedTo(e, viewModelState);
        }
示例#10
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            if (e.Parameter is string)
            {
                SearchOption = PagePayloadBase.FromParameterString <CommunitySearchPagePayloadContent>(e.Parameter as string);
            }

            if (SearchOption == null)
            {
                throw new Exception("コミュニティ検索");
            }


            Models.Db.SearchHistoryDb.Searched(SearchOption.Keyword, SearchOption.SearchTarget);

            var target     = "コミュニティ";
            var optionText = Util.SortHelper.ToCulturizedText(SearchOption.Sort, SearchOption.Order);
            var mode       = SearchOption.Mode == CommunitySearchMode.Keyword ? "キーワード" : "タグ";

            UpdateTitle($"{SearchOption.Keyword} - {target}/{optionText}({mode})");

            base.OnNavigatedTo(e, viewModelState);
        }