public ChannelVideoPageViewModel(
            ILoggerFactory loggerFactory,
            ApplicationLayoutManager applicationLayoutManager,
            NiconicoSession niconicoSession,
            ChannelProvider channelProvider,
            ChannelFollowProvider channelFollowProvider,
            PageManager pageManager,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            OpenLinkCommand openLinkCommand,
            SelectionModeToggleCommand selectionModeToggleCommand
            )
            : base(loggerFactory.CreateLogger <ChannelVideoPageViewModel>())
        {
            ApplicationLayoutManager = applicationLayoutManager;
            NiconicoSession          = niconicoSession;
            ChannelProvider          = channelProvider;
            _channelFollowProvider   = channelFollowProvider;
            PageManager = pageManager;
            VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            OpenLinkCommand            = openLinkCommand;
            SelectionModeToggleCommand = selectionModeToggleCommand;

            CurrentPlaylistToken = Observable.CombineLatest(
                this.ObserveProperty(x => x.ChannelVideoPlaylist),
                this.ObserveProperty(x => x.SelectedSortOption),
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);
        }
Exemple #2
0
        public LocalPlaylistPageViewModel(
            ILoggerFactory loggerFactory,
            IMessenger messenger,
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            LocalMylistManager localMylistManager,
            NicoVideoProvider nicoVideoProvider,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            LocalPlaylistDeleteCommand localPlaylistDeleteCommand,
            SelectionModeToggleCommand selectionModeToggleCommand
            )
            : base(loggerFactory.CreateLogger <LocalPlaylistPageViewModel>())
        {
            ApplicationLayoutManager   = applicationLayoutManager;
            _pageManager               = pageManager;
            _localMylistManager        = localMylistManager;
            _nicoVideoProvider         = nicoVideoProvider;
            LocalPlaylistDeleteCommand = localPlaylistDeleteCommand;
            VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            SelectionModeToggleCommand = selectionModeToggleCommand;
            _messenger = messenger;

            CurrentPlaylistToken = Observable.CombineLatest(
                this.ObserveProperty(x => x.Playlist),
                this.ObserveProperty(x => x.SelectedSortOptionItem),
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);
        }
        public SubscriptionPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            SubscriptionManager subscriptionManager,
            Services.PageManager pageManager,
            Services.WatchItLater watchItLater
            )
        {
            ApplicationLayoutManager = applicationLayoutManager;
            SubscriptionManager      = subscriptionManager;
            WatchItLater             = watchItLater;

            SelectedSubscription = new ReactiveProperty <Subscription>()
                                   .AddTo(_CompositeDisposable);

            SubscriptionManager.Subscriptions.ObserveAddChanged()
            .Subscribe(item =>
            {
                if (_prevRemovedSubscriptionId == item.Id)
                {
                    return;
                }

                SelectedSubscription.Value = item;
            })
            .AddTo(_CompositeDisposable);

            SubscriptionManager.Subscriptions.ObserveRemoveChanged()
            .Subscribe(item =>
            {
                SelectedSubscription.Value = SelectedSubscription.Value == item ? null : SelectedSubscription.Value;

                _prevRemovedSubscriptionId = item.Id;
            })
            .AddTo(_CompositeDisposable);
        }
        public VideoQueuePageViewModel(
            ILoggerFactory loggerFactory,
            IMessenger messenger,
            QueuePlaylist queuePlaylist,
            QueuePlaylistSetting queuePlaylistSetting,
            ApplicationLayoutManager applicationLayoutManager,
            RemoveWatchedItemsInAfterWatchPlaylistCommand removeWatchedItemsInAfterWatchPlaylistCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            SelectionModeToggleCommand selectionModeToggleCommand,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            NicoVideoProvider nicoVideoProvider
            )
            : base(loggerFactory.CreateLogger <VideoQueuePageViewModel>())
        {
            _messenger               = messenger;
            QueuePlaylist            = queuePlaylist;
            _queuePlaylistSetting    = queuePlaylistSetting;
            ApplicationLayoutManager = applicationLayoutManager;
            RemoveWatchedItemsInAfterWatchPlaylistCommand = removeWatchedItemsInAfterWatchPlaylistCommand;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            SelectionModeToggleCommand = selectionModeToggleCommand;
            VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
            _nicoVideoProvider         = nicoVideoProvider;

            IsEnableGroupingByTitleSimulality = _queuePlaylistSetting.ToReactivePropertyAsSynchronized(x => x.IsGroupingNearByTitleThenByTitleAscending, mode: ReactivePropertyMode.DistinctUntilChanged)
                                                .AddTo(_CompositeDisposable);

            CurrentPlaylistToken = this.ObserveProperty(x => x.SelectedSortOptionItem)
                                   .Select(x => new PlaylistToken(QueuePlaylist, x))
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);
        }
Exemple #5
0
        public NicoRepoPageViewModel(
            IScheduler scheduler,
            ApplicationLayoutManager applicationLayoutManager,
            HohoemaPlaylist hohoemaPlaylist,
            Services.PageManager pageManager,
            ActivityFeedSettings activityFeedSettings,
            Models.Provider.LoginUserNicoRepoProvider loginUserNicoRepoProvider,
            Models.Subscription.SubscriptionManager subscriptionManager,
            OpenLiveContentCommand openLiveContentCommand
            )
        {
            _scheduler = scheduler;
            ApplicationLayoutManager  = applicationLayoutManager;
            HohoemaPlaylist           = hohoemaPlaylist;
            ActivityFeedSettings      = activityFeedSettings;
            LoginUserNicoRepoProvider = loginUserNicoRepoProvider;
            SubscriptionManager       = subscriptionManager;
            _openLiveContentCommand   = openLiveContentCommand;
            DisplayNicoRepoItemTopics = new ObservableCollection <NicoRepoItemTopic>(ActivityFeedSettings.DisplayNicoRepoItemTopics);

            DisplayNicoRepoItemTopics.CollectionChangedAsObservable()
            .Subscribe(_ =>
            {
                _NicoRepoItemTopicsChanged = true;
            })
            .AddTo(_CompositeDisposable);
        }
Exemple #6
0
        public UserVideoPageViewModel(
            ILoggerFactory loggerFactory,
            ApplicationLayoutManager applicationLayoutManager,
            UserProvider userProvider,
            SubscriptionManager subscriptionManager,
            PageManager pageManager,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            AddSubscriptionCommand addSubscriptionCommand,
            SelectionModeToggleCommand selectionModeToggleCommand
            )
            : base(loggerFactory.CreateLogger <UserVideoPageViewModel>())
        {
            SubscriptionManager      = subscriptionManager;
            ApplicationLayoutManager = applicationLayoutManager;
            UserProvider             = userProvider;
            PageManager = pageManager;
            VideoPlayWithQueueCommand  = videoPlayWithQueueCommand;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            AddSubscriptionCommand     = addSubscriptionCommand;
            SelectionModeToggleCommand = selectionModeToggleCommand;
            UserInfo = new ReactiveProperty <UserInfoViewModel>();

            CurrentPlaylistToken = Observable.CombineLatest(
                this.ObserveProperty(x => x.UserVideoPlaylist),
                this.ObserveProperty(x => x.SelectedSortOption),
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);

            SelectedSortOption = UserVideoPlaylist.DefaultSortOption;
        }
Exemple #7
0
        public FollowManagePageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            NiconicoSession niconicoSession,
            IMessenger messenger,
            UserFollowProvider userFollowProvider,
            TagFollowProvider tagFollowProvider,
            MylistFollowProvider mylistFollowProvider,
            ChannelFollowProvider channelFollowProvider,
            CommunityFollowProvider communityFollowProvider
            )
        {
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager     = pageManager;
            NiconicoSession = niconicoSession;

            _FollowGroups_AvoidListViewMemoryLeak = new object[]
            {
                new FollowUserGroupViewModel(userFollowProvider, pageManager, messenger),
                new FollowTagGroupViewModel(tagFollowProvider, pageManager, messenger),
                new FolloMylistGroupViewModel(mylistFollowProvider, pageManager, messenger),
                new FollowChannelGroupViewModel(channelFollowProvider, pageManager, messenger),
                new FollowCommunityGroupViewModel(communityFollowProvider, NiconicoSession.UserId, pageManager, messenger),
            };
        }
        public SearchResultLivePageViewModel(
            ILoggerFactory loggerFactory,
            ApplicationLayoutManager applicationLayoutManager,
            NiconicoSession niconicoSession,
            SearchProvider searchProvider,
            PageManager pageManager,
            SearchHistoryRepository searchHistoryRepository,
            NicoLiveCacheRepository nicoLiveCacheRepository,
            OpenLiveContentCommand openLiveContentCommand
            )
            : base(loggerFactory.CreateLogger <SearchResultLivePageViewModel>())
        {
            ApplicationLayoutManager = applicationLayoutManager;
            NiconicoSession          = niconicoSession;
            SearchProvider           = searchProvider;
            PageManager = pageManager;
            _searchHistoryRepository = searchHistoryRepository;
            _nicoLiveCacheRepository = nicoLiveCacheRepository;
            OpenLiveContentCommand   = openLiveContentCommand;

            SelectedSearchSort = new ReactiveProperty <LiveSearchPageSortOrder>(SortOptionItems[0], mode: ReactivePropertyMode.DistinctUntilChanged);
            SelectedLiveStatus = new ReactiveProperty <LiveStatus>(LiveStatusItems[0], mode: ReactivePropertyMode.DistinctUntilChanged);
            SelectedProviders  = new ObservableCollection <ProviderType>();

            IsTagSearch          = new ReactiveProperty <bool>(false);
            IsTimeshiftAvairable = new ReactiveProperty <bool>(false);
            IsHideMemberOnly     = new ReactiveProperty <bool>(false);
            IsDisableGrouping    = new ReactiveProperty <bool>(false);

            Observable.Merge(
                SelectedSearchSort.ToUnit(),
                SelectedLiveStatus.ToUnit(),
                SelectedProviders.CollectionChangedAsObservable().ToUnit()
                )
            .Subscribe(async _ =>
            {
                if (_NowNavigatingTo)
                {
                    return;
                }

                if (_query is not null)
                {
                    if (_query.Keyword == Keyword &&
                        _query.SortOrder == SelectedSearchSort.Value &&
                        _query.LiveStatus == SelectedLiveStatus.Value &&
                        (_query.ProviderTypes?.Any() ?? false) &&
                        SelectedProviders.Count == _query.ProviderTypes.Length &&
                        SelectedProviders.All(x => _query.ProviderTypes.Contains(x))
                        )
                    {
                        return;
                    }
                }

                ResetList();
            })
            .AddTo(_CompositeDisposable);
        }
Exemple #9
0
 public VideoInfomationPageViewModel(
     ILoggerFactory loggerFactory,
     ApplicationLayoutManager applicationLayoutManager,
     AppearanceSettings appearanceSettings,
     VideoFilteringSettings ngSettings,
     NiconicoSession niconicoSession,
     LoginUserOwnedMylistManager userMylistManager,
     NicoVideoProvider nicoVideoProvider,
     LoginUserMylistProvider loginUserMylistProvider,
     SubscriptionManager subscriptionManager,
     NicoVideoSessionProvider nicoVideo,
     PageManager pageManager,
     Services.NotificationService notificationService,
     Services.DialogService dialogService,
     VideoPlayWithQueueCommand videoPlayWithQueueCommand,
     MylistAddItemCommand addMylistCommand,
     LocalPlaylistAddItemCommand localPlaylistAddItemCommand,
     AddSubscriptionCommand addSubscriptionCommand,
     OpenLinkCommand openLinkCommand,
     CopyToClipboardCommand copyToClipboardCommand,
     CopyToClipboardWithShareTextCommand copyToClipboardWithShareTextCommand,
     OpenShareUICommand openShareUICommand,
     CacheAddRequestCommand cacheAddRequestCommand,
     RecommendProvider recommendProvider,
     UserFollowProvider userFollowProvider,
     ChannelFollowProvider channelFollowProvider
     )
 {
     _logger = loggerFactory.CreateLogger <VideoInfomationPageViewModel>();
     ApplicationLayoutManager = applicationLayoutManager;
     AppearanceSettings       = appearanceSettings;
     NgSettings              = ngSettings;
     NiconicoSession         = niconicoSession;
     UserMylistManager       = userMylistManager;
     NicoVideoProvider       = nicoVideoProvider;
     LoginUserMylistProvider = loginUserMylistProvider;
     SubscriptionManager     = subscriptionManager;
     NicoVideo                           = nicoVideo;
     PageManager                         = pageManager;
     NotificationService                 = notificationService;
     DialogService                       = dialogService;
     VideoPlayWithQueueCommand           = videoPlayWithQueueCommand;
     AddMylistCommand                    = addMylistCommand;
     LocalPlaylistAddItemCommand         = localPlaylistAddItemCommand;
     AddSubscriptionCommand              = addSubscriptionCommand;
     OpenLinkCommand                     = openLinkCommand;
     CopyToClipboardCommand              = copyToClipboardCommand;
     CopyToClipboardWithShareTextCommand = copyToClipboardWithShareTextCommand;
     OpenShareUICommand                  = openShareUICommand;
     CacheAddRequestCommand              = cacheAddRequestCommand;
     _recommendProvider                  = recommendProvider;
     _userFollowProvider                 = userFollowProvider;
     _channelFollowProvider              = channelFollowProvider;
     NowLoading                          = new ReactiveProperty <bool>(false);
     IsLoadFailed                        = new ReactiveProperty <bool>(false);
 }
        public SearchResultTagPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            NGSettings ngSettings,
            Models.NiconicoSession niconicoSession,
            SearchProvider searchProvider,
            SubscriptionManager subscriptionManager,
            HohoemaPlaylist hohoemaPlaylist,
            Services.PageManager pageManager,
            Services.DialogService dialogService,
            Commands.Subscriptions.CreateSubscriptionGroupCommand createSubscriptionGroupCommand,
            NiconicoFollowToggleButtonService followButtonService
            )
        {
            SearchProvider           = searchProvider;
            SubscriptionManager      = subscriptionManager;
            HohoemaPlaylist          = hohoemaPlaylist;
            PageManager              = pageManager;
            ApplicationLayoutManager = applicationLayoutManager;
            NgSettings                     = ngSettings;
            NiconicoSession                = niconicoSession;
            HohoemaDialogService           = dialogService;
            CreateSubscriptionGroupCommand = createSubscriptionGroupCommand;
            FollowButtonService            = followButtonService;
            FailLoading                    = new ReactiveProperty <bool>(false)
                                             .AddTo(_CompositeDisposable);

            LoadedPage = new ReactiveProperty <int>(1)
                         .AddTo(_CompositeDisposable);



            SelectedSearchSort = new ReactiveProperty <SearchSortOptionListItem>(
                VideoSearchOptionListItems.First(),
                mode: ReactivePropertyMode.DistinctUntilChanged
                );

            SelectedSearchSort
            .Subscribe(async _ =>
            {
                var selected = SelectedSearchSort.Value;
                if (SearchOption.Order == selected.Order &&
                    SearchOption.Sort == selected.Sort
                    )
                {
                    return;
                }

                SearchOption.Order = selected.Order;
                SearchOption.Sort  = selected.Sort;

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

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();
        }
 public CommunityVideoPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     CommunityProvider communityProvider,
     Services.PageManager pageManager
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     CommunityProvider        = communityProvider;
     PageManager = pageManager;
 }
Exemple #12
0
 public SearchResultMylistPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     SearchProvider searchProvider,
     Services.PageManager pageManager
     )
 {
     SelectedSearchSort       = new ReactivePropertySlim <SearchSortOptionListItem>();
     SelectedSearchTarget     = new ReactiveProperty <SearchTarget>();
     ApplicationLayoutManager = applicationLayoutManager;
     SearchProvider           = searchProvider;
     PageManager = pageManager;
 }
Exemple #13
0
        public SearchResultLivePageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            Models.NiconicoSession niconicoSession,
            SearchProvider searchProvider,
            Services.PageManager pageManager,
            HohoemaPlaylist hohoemaPlaylist,
            OpenLiveContentCommand openLiveContentCommand
            )
        {
            SelectedSearchSort = new ReactiveProperty <LiveSearchSortOptionListItem>(LiveSearchSortOptionListItems[0], mode: ReactivePropertyMode.DistinctUntilChanged);
            SelectedSearchMode = new ReactiveProperty <LiveSearchModeOptionListItem>(LiveSearchModeOptionListItems[0], mode: ReactivePropertyMode.DistinctUntilChanged);
            SelectedProvider   = new ReactiveProperty <LiveSearchProviderOptionListItem>(LiveSearchProviderOptionListItems[0], mode: ReactivePropertyMode.DistinctUntilChanged);

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();

            Observable.Merge(
                SelectedSearchSort.ToUnit(),
                SelectedSearchMode.ToUnit(),
                SelectedProvider.ToUnit()
                )
            .Subscribe(async _ =>
            {
                if (_NowNavigatingTo)
                {
                    return;
                }

                var selected = SelectedSearchSort.Value;
                if (SearchOption.Order == selected.Order &&
                    SearchOption.Sort == selected.Sort &&
                    SearchOption.Mode == SelectedSearchMode.Value?.Mode &&
                    SearchOption.Provider == SelectedProvider.Value?.Provider
                    )
                {
                    return;
                }

                SearchOption.Mode     = SelectedSearchMode.Value.Mode;
                SearchOption.Provider = SelectedProvider.Value.Provider;
                SearchOption.Sort     = SelectedSearchSort.Value.Sort;
                SearchOption.Order    = SelectedSearchSort.Value.Order;

                await ResetList();
            })
            .AddTo(_CompositeDisposable);
            ApplicationLayoutManager = applicationLayoutManager;
            NiconicoSession          = niconicoSession;
            SearchProvider           = searchProvider;
            PageManager            = pageManager;
            HohoemaPlaylist        = hohoemaPlaylist;
            OpenLiveContentCommand = openLiveContentCommand;
        }
Exemple #14
0
 public RecommendPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     NGSettings ngSettings,
     LoginUserRecommendProvider loginUserRecommendProvider,
     HohoemaPlaylist hohoemaPlaylist,
     Services.PageManager pageManager
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     NgSettings = ngSettings;
     LoginUserRecommendProvider = loginUserRecommendProvider;
     HohoemaPlaylist            = hohoemaPlaylist;
     PageManager = pageManager;
 }
Exemple #15
0
 public SearchResultMylistPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     SearchProvider searchProvider,
     PageManager pageManager,
     SearchHistoryRepository searchHistoryRepository
     )
 {
     SelectedSearchSort       = new ReactivePropertySlim <MylistSearchSortOptionListItem>();
     SelectedSearchTarget     = new ReactiveProperty <SearchTarget>();
     ApplicationLayoutManager = applicationLayoutManager;
     SearchProvider           = searchProvider;
     PageManager = pageManager;
     _searchHistoryRepository = searchHistoryRepository;
 }
Exemple #16
0
        public SearchResultKeywordPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            NGSettings ngSettings,
            SearchProvider searchProvider,
            SubscriptionManager subscriptionManager,
            HohoemaPlaylist hohoemaPlaylist,
            Services.PageManager pageManager,
            Commands.Subscriptions.CreateSubscriptionGroupCommand createSubscriptionGroupCommand
            )
        {
            FailLoading = new ReactiveProperty <bool>(false)
                          .AddTo(_CompositeDisposable);

            LoadedPage = new ReactiveProperty <int>(1)
                         .AddTo(_CompositeDisposable);

            SelectedSearchSort = new ReactiveProperty <SearchSortOptionListItem>(
                VideoSearchOptionListItems.First(),
                mode: ReactivePropertyMode.DistinctUntilChanged
                );

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();

            SelectedSearchSort
            .Subscribe(async _ =>
            {
                var selected = SelectedSearchSort.Value;
                if (SearchOption.Order == selected.Order &&
                    SearchOption.Sort == selected.Sort
                    )
                {
                    //                       return;
                }

                SearchOption.Sort  = SelectedSearchSort.Value.Sort;
                SearchOption.Order = SelectedSearchSort.Value.Order;

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

            ApplicationLayoutManager = applicationLayoutManager;
            NgSettings                     = ngSettings;
            SearchProvider                 = searchProvider;
            HohoemaPlaylist                = hohoemaPlaylist;
            PageManager                    = pageManager;
            SubscriptionManager            = subscriptionManager;
            CreateSubscriptionGroupCommand = createSubscriptionGroupCommand;
        }
Exemple #17
0
        public SearchResultCommunityPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            SearchProvider searchProvider,
            Services.NiconicoLoginService niconicoLoginService
            )
        {
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager          = pageManager;
            SearchProvider       = searchProvider;
            NiconicoLoginService = niconicoLoginService;
            SelectedSearchSort   = new ReactivePropertySlim <CommunitySearchSortOptionListItem>();
            SelectedSearchMode   = new ReactivePropertySlim <CommynitySearchModeOptionListItem>();

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();
        }
Exemple #18
0
 public UserVideoPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     UserProvider userProvider,
     SubscriptionManager subscriptionManager,
     HohoemaPlaylist hohoemaPlaylist,
     PageManager pageManager,
     CreateSubscriptionGroupCommand createSubscriptionGroupCommand
     )
 {
     SubscriptionManager      = subscriptionManager;
     ApplicationLayoutManager = applicationLayoutManager;
     UserProvider             = userProvider;
     HohoemaPlaylist          = hohoemaPlaylist;
     PageManager = pageManager;
     CreateSubscriptionGroupCommand = createSubscriptionGroupCommand;
 }
Exemple #19
0
 public TimeshiftPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     LoginUserLiveReservationProvider loginUserLiveReservationProvider,
     NicoLiveProvider nicoLiveProvider,
     HohoemaPlaylist hohoemaPlaylist,
     NoUIProcessScreenContext noUIProcessScreenContext,
     Services.DialogService dialogService
     )
 {
     ApplicationLayoutManager         = applicationLayoutManager;
     LoginUserLiveReservationProvider = loginUserLiveReservationProvider;
     NicoLiveProvider          = nicoLiveProvider;
     HohoemaPlaylist           = hohoemaPlaylist;
     _noUIProcessScreenContext = noUIProcessScreenContext;
     DialogService             = dialogService;
 }
 public CommunityPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     AppearanceSettings appearanceSettings,
     PageManager pageManager,
     NiconicoSession niconicoSession,
     CommunityFollowProvider communityFollowProvider,
     CommunityProvider communityProvider
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     _appearanceSettings      = appearanceSettings;
     PageManager              = pageManager;
     NiconicoSession          = niconicoSession;
     _communityFollowProvider = communityFollowProvider;
     CommunityProvider        = communityProvider;
 }
Exemple #21
0
 public WatchHistoryPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     NiconicoSession niconicoSession,
     WatchHistoryManager watchHistoryManager,
     HohoemaPlaylist hohoemaPlaylist,
     Services.PageManager pageManager,
     WatchHistoryRemoveAllCommand watchHistoryRemoveAllCommand
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     _niconicoSession         = niconicoSession;
     _watchHistoryManager     = watchHistoryManager;
     HohoemaPlaylist          = hohoemaPlaylist;
     PageManager = pageManager;
     WatchHistoryRemoveAllCommand = watchHistoryRemoveAllCommand;
     Histories = new ObservableCollection <HistoryVideoInfoControlViewModel>();
 }
Exemple #22
0
        public SearchResultTagPageViewModel(
            ILoggerFactory loggerFactory,
            ApplicationLayoutManager applicationLayoutManager,
            NiconicoSession niconicoSession,
            SearchProvider searchProvider,
            TagFollowProvider tagFollowProvider,
            SubscriptionManager subscriptionManager,
            PageManager pageManager,
            SearchHistoryRepository searchHistoryRepository,
            Services.DialogService dialogService,
            VideoPlayWithQueueCommand videoPlayWithQueueCommand,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            AddTagSearchSubscriptionCommand addTagSearchSubscriptionCommand,
            SelectionModeToggleCommand selectionModeToggleCommand
            )
            : base(loggerFactory.CreateLogger <SearchResultTagPageViewModel>())
        {
            SearchProvider                  = searchProvider;
            _tagFollowProvider              = tagFollowProvider;
            SubscriptionManager             = subscriptionManager;
            PageManager                     = pageManager;
            _searchHistoryRepository        = searchHistoryRepository;
            ApplicationLayoutManager        = applicationLayoutManager;
            NiconicoSession                 = niconicoSession;
            HohoemaDialogService            = dialogService;
            VideoPlayWithQueueCommand       = videoPlayWithQueueCommand;
            PlaylistPlayAllCommand          = playlistPlayAllCommand;
            AddTagSearchSubscriptionCommand = addTagSearchSubscriptionCommand;
            SelectionModeToggleCommand      = selectionModeToggleCommand;
            FailLoading                     = new ReactiveProperty <bool>(false)
                                              .AddTo(_CompositeDisposable);

            LoadedPage = new ReactiveProperty <int>(1)
                         .AddTo(_CompositeDisposable);

            SelectedSearchTarget = new ReactiveProperty <SearchTarget>();


            CurrentPlaylistToken = Observable.CombineLatest(
                this.ObserveProperty(x => x.SearchVideoPlaylist),
                this.ObserveProperty(x => x.SelectedSortOption),
                (x, y) => new PlaylistToken(x, y)
                )
                                   .ToReadOnlyReactivePropertySlim()
                                   .AddTo(_CompositeDisposable);
        }
Exemple #23
0
        // TODO: ログインエラー時のテキスト表示

        public LoginPageViewModel(
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            NiconicoSession niconicoSession
            )
        {
            PageManager     = pageManager;
            NiconicoSession = niconicoSession;

            var version = Windows.ApplicationModel.Package.Current.Id.Version;

            VersionText = $"{version.Major}.{version.Minor}.{version.Build}";

            Mail     = new ReactiveProperty <string>("", mode: ReactivePropertyMode.DistinctUntilChanged);
            Password = new ReactiveProperty <string>("", mode: ReactivePropertyMode.DistinctUntilChanged);

            IsRememberPassword = new ReactiveProperty <bool>(!string.IsNullOrEmpty(Password.Value));

            IsValidAccount        = new ReactiveProperty <bool>(NiconicoSession.IsLoggedIn);
            NowProcessLoggedIn    = new ReactiveProperty <bool>(false);
            IsAuthoricationFailed = new ReactiveProperty <bool>(false);
            IsServiceUnavailable  = new ReactiveProperty <bool>(false);

            // メールかパスワードが変更されたらログイン検証されていないアカウントとしてマーク
            TryLoginCommand = Observable.CombineLatest(
                Mail.Select(x => !string.IsNullOrWhiteSpace(x)),
                Password.Select(x => !string.IsNullOrWhiteSpace(x)),
                NowProcessLoggedIn.Select(x => !x)
                )
                              .Select(x => x.All(y => y))
                              .ToReactiveCommand();

            TryLoginCommand.Subscribe(async _ =>
            {
                NowProcessLoggedIn.Value = true;

                try
                {
                    await TryLogin();
                }
                finally
                {
                    NowProcessLoggedIn.Value = false;
                }
            });
        }
        public RankingCategoryListPageViewModel(
            IMessenger messenger,
            ApplicationLayoutManager applicationLayoutManager,
            PageManager pageManager,
            Services.DialogService dialogService,
            VideoRankingSettings rankingSettings,
            AppFlagsRepository appFlagsRepository,
            RankingProvider rankingProvider
            )
        {
            _messenger = messenger;
            ApplicationLayoutManager = applicationLayoutManager;
            PageManager          = pageManager;
            HohoemaDialogService = dialogService;
            RankingSettings      = rankingSettings;
            _appFlagsRepository  = appFlagsRepository;
            _rankingProvider     = rankingProvider;

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

            // TODO: ログインユーザーが成年であればR18ジャンルを表示するように
            _RankingGenreItemsSource = new List <RankingGenreItem>();

            FavoriteItems = new ObservableCollection <RankingItem>(GetFavoriteRankingItems());
            _favoriteRankingGenreGroupItem = new FavoriteRankingGenreGroupItem()
            {
                Label = "FavoriteRankingTag".Translate(),
                Items = new AdvancedCollectionView(FavoriteItems)
            };
            _RankingGenreItemsSource.Add(_favoriteRankingGenreGroupItem);


            var sourceGenreItems = Enum.GetValues(typeof(RankingGenre)).Cast <RankingGenre>()
                                   .Where(x => x != RankingGenre.R18)
                                   .Select(genre =>
            {
                var rankingItems = ToRankingItem(genre, _rankingProvider.GetRankingGenreTagsFromCache(genre));
                var acv          = new AdvancedCollectionView(new ObservableCollection <RankingItem>(rankingItems), isLiveShaping: true)
                {
                    Filter = (item) =>
                    {
                        if (item is RankingItem rankingItem && rankingItem.Genre != null)
                        {
                            return(!(RankingSettings.IsHiddenGenre(rankingItem.Genre.Value) || RankingSettings.IsHiddenTag(rankingItem.Genre.Value, rankingItem.Tag)));
                        }
Exemple #25
0
 public ChannelVideoPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     NiconicoSession niconicoSession,
     ChannelProvider channelProvider,
     PageManager pageManager,
     HohoemaPlaylist hohoemaPlaylist,
     ExternalAccessService externalAccessService,
     NiconicoFollowToggleButtonService followToggleButtonService
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     NiconicoSession          = niconicoSession;
     ChannelProvider          = channelProvider;
     PageManager               = pageManager;
     HohoemaPlaylist           = hohoemaPlaylist;
     ExternalAccessService     = externalAccessService;
     FollowToggleButtonService = followToggleButtonService;
 }
 public TimeshiftPageViewModel(
     ILoggerFactory loggerFactory,
     ApplicationLayoutManager applicationLayoutManager,
     LoginUserLiveReservationProvider loginUserLiveReservationProvider,
     NicoLiveProvider nicoLiveProvider,
     NoUIProcessScreenContext noUIProcessScreenContext,
     Services.DialogService dialogService,
     OpenLiveContentCommand openLiveContentCommand
     )
     : base(loggerFactory.CreateLogger <TimeshiftPageViewModel>())
 {
     ApplicationLayoutManager         = applicationLayoutManager;
     LoginUserLiveReservationProvider = loginUserLiveReservationProvider;
     NicoLiveProvider          = nicoLiveProvider;
     _noUIProcessScreenContext = noUIProcessScreenContext;
     DialogService             = dialogService;
     OpenLiveContentCommand    = openLiveContentCommand;
 }
Exemple #27
0
 public CommunityPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     AppearanceSettings appearanceSettings,
     Services.PageManager pageManager,
     NiconicoSession niconicoSession,
     CommunityFollowProvider followProvider,
     CommunityProvider communityProvider,
     FollowManager followManager,
     NiconicoFollowToggleButtonService followToggleButtonService
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     _appearanceSettings      = appearanceSettings;
     PageManager               = pageManager;
     NiconicoSession           = niconicoSession;
     FollowProvider            = followProvider;
     CommunityProvider         = communityProvider;
     FollowToggleButtonService = followToggleButtonService;
 }
        public LocalPlaylistManagePageViewModel(
            PageManager pageManager,
            Services.DialogService dialogService,
            ApplicationLayoutManager applicationLayoutManager,
            LocalMylistManager localMylistManager,
            PlaylistPlayAllCommand playlistPlayAllCommand,
            LocalPlaylistCreateCommand localPlaylistCreateCommand,
            LocalPlaylistDeleteCommand localPlaylistDeleteCommand
            )
        {
            _pageManager               = pageManager;
            ApplicationLayoutManager   = applicationLayoutManager;
            _localMylistManager        = localMylistManager;
            PlaylistPlayAllCommand     = playlistPlayAllCommand;
            CreateLocalMylistCommand   = localPlaylistCreateCommand;
            DeleteLocalPlaylistCommand = localPlaylistDeleteCommand;
            ItemsView = new AdvancedCollectionView(_localMylistManager.LocalPlaylists);

            OpenMylistCommand = new ReactiveCommand <IPlaylist>()
                                .AddTo(_CompositeDisposable);

            OpenMylistCommand.Subscribe(listItem =>
            {
                _pageManager.OpenPageWithId(HohoemaPageType.LocalPlaylist, listItem.PlaylistId.Id);
            });


            RenameLocalPlaylistCommand = new RelayCommand <LocalPlaylist>(async playlist =>
            {
                var result = await dialogService.GetTextAsync(
                    "RenameLocalPlaylist",
                    "RenameLocalPlaylist_Placeholder",
                    playlist.Name,
                    name => !string.IsNullOrWhiteSpace(name)
                    );

                if (result is not null)
                {
                    playlist.Name = result;
                }
            });
        }
 public LocalPlaylistPageViewModel(
     ApplicationLayoutManager applicationLayoutManager,
     PageManager pageManager,
     LocalMylistManager localMylistManager,
     HohoemaPlaylist hohoemaPlaylist,
     PlaylistAggregateGetter playlistAggregate,
     LocalPlaylistDeleteCommand localPlaylistDeleteCommand,
     PlaylistPlayAllCommand playlistPlayAllCommand,
     RemoveWatchedItemsInAfterWatchPlaylistCommand removeWatchedItemsInAfterWatchPlaylistCommand
     )
 {
     ApplicationLayoutManager = applicationLayoutManager;
     _pageManager = pageManager;
     _localMylistManager = localMylistManager;
     HohoemaPlaylist = hohoemaPlaylist;
     _playlistAggregate = playlistAggregate;
     LocalPlaylistDeleteCommand = localPlaylistDeleteCommand;
     PlaylistPlayAllCommand = playlistPlayAllCommand;
     RemoveWatchedItemsInAfterWatchPlaylistCommand = removeWatchedItemsInAfterWatchPlaylistCommand;
 }
Exemple #30
0
 public UserMylistPageViewModel(
     ILoggerFactory loggerFactory,
     ApplicationLayoutManager applicationLayoutManager,
     PageManager pageManager,
     Services.DialogService dialogService,
     NiconicoSession niconicoSession,
     UserProvider userProvider,
     MylistResolver mylistRepository,
     LocalMylistManager localMylistManager
     )
     : base(loggerFactory.CreateLogger <UserMylistPageViewModel>())
 {
     ApplicationLayoutManager = applicationLayoutManager;
     PageManager         = pageManager;
     DialogService       = dialogService;
     NiconicoSession     = niconicoSession;
     UserProvider        = userProvider;
     _mylistRepository   = mylistRepository;
     _localMylistManager = localMylistManager;
 }