Beispiel #1
0
        public SearchResultCommunityPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            SearchProvider searchProvider,
            NiconicoLoginService niconicoLoginService,
            SearchHistoryRepository searchHistoryRepository
            )
        {
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager              = pageManager;
            SearchProvider           = searchProvider;
            NiconicoLoginService     = niconicoLoginService;
            _searchHistoryRepository = searchHistoryRepository;
            SelectedSearchSort       = new ReactivePropertySlim <CommunitySearchSortOptionListItem>();
            SelectedSearchMode       = new ReactivePropertySlim <CommynitySearchModeOptionListItem>();

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();
        }
Beispiel #2
0
 public PrimaryWindowCoreLayoutViewModel(
     IEventAggregator eventAggregator,
     NiconicoSession niconicoSession,
     PageManager pageManager,
     PinSettings pinSettings,
     AppearanceSettings appearanceSettings,
     UseCase.Page.Commands.SearchCommand searchCommand,
     PinRemoveCommand pinRemoveCommand,
     PinChangeOverrideLabelCommand pinChangeOverrideLabelCommand,
     VideoMenuSubPageContent videoMenuSubPageContent,
     LiveMenuSubPageContent liveMenuSubPageContent,
     PrimaryViewPlayerManager primaryViewPlayerManager,
     ObservableMediaPlayer observableMediaPlayer,
     NiconicoLoginService niconicoLoginService,
     LogoutFromNiconicoCommand logoutFromNiconicoCommand,
     VideoItemsSelectionContext videoItemsSelectionContext,
     WindowService windowService,
     ApplicationLayoutManager applicationLayoutManager
     )
 {
     EventAggregator               = eventAggregator;
     NiconicoSession               = niconicoSession;
     PageManager                   = pageManager;
     PinSettings                   = pinSettings;
     AppearanceSettings            = appearanceSettings;
     SearchCommand                 = searchCommand;
     PinRemoveCommand              = pinRemoveCommand;
     PinChangeOverrideLabelCommand = pinChangeOverrideLabelCommand;
     VideoMenu = videoMenuSubPageContent;
     LiveMenu  = liveMenuSubPageContent;
     PrimaryViewPlayerManager   = primaryViewPlayerManager;
     ObservableMediaPlayer      = observableMediaPlayer;
     NiconicoLoginService       = niconicoLoginService;
     LogoutFromNiconicoCommand  = logoutFromNiconicoCommand;
     VideoItemsSelectionContext = videoItemsSelectionContext;
     WindowService            = windowService;
     ApplicationLayoutManager = applicationLayoutManager;
 }
        public PrimaryWindowCoreLayoutViewModel(
            ILoggerFactory loggerFactory,
            NiconicoSession niconicoSession,
            PageManager pageManager,
            PinSettings pinSettings,
            AppearanceSettings appearanceSettings,
            SearchCommand searchCommand,
            DialogService dialogService,
            NotificationService notificationService,
            PrimaryViewPlayerManager primaryViewPlayerManager,
            ObservableMediaPlayer observableMediaPlayer,
            NiconicoLoginService niconicoLoginService,
            LogoutFromNiconicoCommand logoutFromNiconicoCommand,
            WindowService windowService,
            ApplicationLayoutManager applicationLayoutManager,
            RestoreNavigationManager restoreNavigationManager,
            VideoItemsSelectionContext videoItemsSelectionContext,
            QueueMenuItemViewModel queueMenuItemViewModel,
            LoginUserOwnedMylistManager userMylistManager,
            LocalMylistManager localMylistManager,
            OpenLiveContentCommand openLiveContentCommand
            )
        {
            _logger                    = loggerFactory.CreateLogger <PrimaryWindowCoreLayoutViewModel>();
            NiconicoSession            = niconicoSession;
            PageManager                = pageManager;
            PinSettings                = pinSettings;
            AppearanceSettings         = appearanceSettings;
            SearchCommand              = searchCommand;
            _dialogService             = dialogService;
            _notificationService       = notificationService;
            PrimaryViewPlayerManager   = primaryViewPlayerManager;
            ObservableMediaPlayer      = observableMediaPlayer;
            NiconicoLoginService       = niconicoLoginService;
            LogoutFromNiconicoCommand  = logoutFromNiconicoCommand;
            WindowService              = windowService;
            ApplicationLayoutManager   = applicationLayoutManager;
            RestoreNavigationManager   = restoreNavigationManager;
            VideoItemsSelectionContext = videoItemsSelectionContext;

            WeakReferenceMessenger.Default.Register <SettingsRestoredMessage>(this);

            SearchAutoSuggestItems = new ObservableCollection <SearchAutoSuggestItemViewModel>
            {
                new SearchAutoSuggestItemViewModel()
                {
                    Id           = "VideoSearchSuggest",
                    SearchAction = (s) => PageManager.Search(SearchTarget.Keyword, s),
                },
                new SearchAutoSuggestItemViewModel()
                {
                    Id           = "LiveSearchSuggest",
                    SearchAction = (s) => PageManager.Search(SearchTarget.Niconama, s),
                },
                new SearchAutoSuggestItemViewModel()
                {
                    Id           = "DetailSearchSuggest",
                    SearchAction = (s) => PageManager.OpenPage(HohoemaPageType.Search, ""),
                },
            };

            _queueMenuItemViewModel          = queueMenuItemViewModel;
            _userMylistManager               = userMylistManager;
            _localMylistManager              = localMylistManager;
            OpenLiveContentCommand           = openLiveContentCommand;
            _pinsMenuSubItemViewModel        = new PinsMenuSubItemViewModel("Pin".Translate(), PinSettings, _dialogService, _notificationService);
            _localMylistMenuSubItemViewModel = new LocalMylistSubMenuItemViewModel(_localMylistManager, PageManager.OpenPageCommand);

            // メニュー項目の初期化
            MenuItems_LoggedIn = new ObservableCollection <HohoemaListingPageItemBase>()
            {
                _pinsMenuSubItemViewModel,
                _queueMenuItemViewModel,
                new LogginUserLiveSummaryItemViewModel(NiconicoSession, _logger, OpenLiveContentCommand),
                new SeparatorMenuItemViewModel(),
                new MenuItemViewModel(HohoemaPageType.RankingCategoryList.Translate(), HohoemaPageType.RankingCategoryList),
                new MenuItemViewModel(HohoemaPageType.NicoRepo.Translate(), HohoemaPageType.NicoRepo),
                new MenuItemViewModel(HohoemaPageType.WatchHistory.Translate(), HohoemaPageType.WatchHistory),
                new MenuItemViewModel("WatchAfterMylist".Translate(), HohoemaPageType.Mylist, new NavigationParameters(("id", MylistId.WatchAfterMylistId.ToString()))),
                new MylistSubMenuMenu(_userMylistManager, PageManager.OpenPageCommand),
                _localMylistMenuSubItemViewModel,
                new MenuItemViewModel(HohoemaPageType.FollowManage.Translate(), HohoemaPageType.FollowManage),
                new MenuItemViewModel(HohoemaPageType.Timeshift.Translate(), HohoemaPageType.Timeshift),
                new MenuItemViewModel(HohoemaPageType.SubscriptionManagement.Translate(), HohoemaPageType.SubscriptionManagement),
                new MenuItemViewModel(HohoemaPageType.CacheManagement.Translate(), HohoemaPageType.CacheManagement),
            };

            MenuItems_Offline = new ObservableCollection <HohoemaListingPageItemBase>()
            {
                _pinsMenuSubItemViewModel,
                _queueMenuItemViewModel,
                new SeparatorMenuItemViewModel(),
                new MenuItemViewModel(HohoemaPageType.RankingCategoryList.Translate(), HohoemaPageType.RankingCategoryList),
                _localMylistMenuSubItemViewModel,
                new MenuItemViewModel(HohoemaPageType.SubscriptionManagement.Translate(), HohoemaPageType.SubscriptionManagement),
                new MenuItemViewModel(HohoemaPageType.CacheManagement.Translate(), HohoemaPageType.CacheManagement),
            };
        }