Exemplo n.º 1
0
        public PopularVKAudioViewModel(
            InTouch inTouch,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            IInTouchWrapper inTouchWrapper,
            IDownloadsServiceHelper downloadsServiceHelper,
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            ISettingsService settingsService,
            IPurchaseService purchaseService)
            : base(inTouch, appLoaderService, dialogsService, inTouchWrapper,
                   downloadsServiceHelper, playerService, locService, navigationService, purchaseService)
        {
            _settingsService = settingsService;

            IsReloadButtonSupported  = true;
            IsPlayButtonSupported    = true;
            IsShuffleButtonSupported = true;

            ShowFilterFlyoutCommand   = new DelegateCommand(OnShowFilterFlyoutCommand);
            FilterFlyoutClosedCommand = new DelegateCommand(OnFilterFlyoutClosedCommand);

            CreateFilters();
        }
Exemplo n.º 2
0
        public AudioSearchViewModel(
            InTouch inTouch,
            INavigationService navigationService,
            ILocService locService,
            ISettingsService settingsService,
            IDialogsService dialogsService,
            IPlayerService playerService,
            IAppLoaderService appLoaderService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IInTouchWrapper inTouchWrapper,
            IPurchaseService purchaseService)
            : base(inTouch, navigationService, locService, settingsService, dialogsService, inTouchWrapper)
        {
            _playerService          = playerService;
            _appLoaderService       = appLoaderService;
            _downloadsServiceHelper = downloadsServiceHelper;
            _purchaseService        = purchaseService;

            DownloadCommand         = new DelegateCommand <Audio>(OnDownloadCommand);
            DownloadSelectedCommand = new DelegateCommand(OnDownloadSelectedCommand, HasSelectedItems);

            AddToMyAudiosCommand         = new DelegateCommand <Audio>(OnAddToMyAudiosCommand, CanAddToMyAudios);
            AddSelectedToMyAudiosCommand = new DelegateCommand(OnAddSelectedToMyAudiosCommand, HasSelectedItems);

            DeleteCommand         = new DelegateCommand <Audio>(OnDeleteCommand, CanDeleteAudio);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);

            PlaySelectedCommand        = new DelegateCommand(OnPlaySelectedCommand, HasSelectedItems);
            ShowPerformerFlyoutCommand = new DelegateCommand(OnShowPerformerFlyoutCommand);
            ShowTrackInfoCommand       = new DelegateCommand <Audio>(OnShowTrackInfoCommand);
        }
Exemplo n.º 3
0
        public TransferViewModel(
            IDownloadsService downloadsService,
            IUploadsService uploadsService,
            IDialogsService dialogsService,
            IAppLoaderService appLoaderService,
            ILocService locService,
            IDispatcherWrapper dispatcherWrapper)
        {
            _downloadsService  = downloadsService;
            _uploadsService    = uploadsService;
            _dialogsService    = dialogsService;
            _appLoaderService  = appLoaderService;
            _locService        = locService;
            _dispatcherWrapper = dispatcherWrapper;

            Downloads = new ObservableCollection <TransferItemViewModel>();
            Uploads   = new ObservableCollection <TransferItemViewModel>();

            ShowInfoCommand           = new DelegateCommand <TransferItemViewModel>(OnShowInfoCommand);
            CancelDownloadCommand     = new DelegateCommand <TransferItemViewModel>(OnCancelDownloadCommand);
            CancelUploadCommand       = new DelegateCommand <TransferItemViewModel>(OnCancelUploadCommand);
            PauseDownloadCommand      = new DelegateCommand <TransferItemViewModel>(OnPauseResumeDownloadCommand);
            ResumeDownloadCommand     = new DelegateCommand <TransferItemViewModel>(OnPauseResumeDownloadCommand);
            CancelAllDownloadsCommand = new DelegateCommand(OnCancelAllDownloadsCommand, CanExecuteCancelAllDownloadsCommand);
            CancelAllUploadsCommand   = new DelegateCommand(OnCancelAllUploadsCommand, CanExecuteCancelAllUploadsCommand);
        }
Exemplo n.º 4
0
 protected AudioViewModel(
     IPlayerService playerService,
     ILocService locService,
     INavigationService navigationService,
     IAppLoaderService appLoaderService,
     int maxPlayingTracks = -1)
     : this(locService, navigationService, playerService, appLoaderService, true, true, maxPlayingTracks)
 {
 }
Exemplo n.º 5
0
        public WithLoaderFrame(
            IAppLoaderService appLoaderService,
            IServiceResolver serviceResolver)
        {
            this.DefaultStyleKey = typeof(WithLoaderFrame);
            AppLoaderService     = appLoaderService;

            _serviceResolver   = serviceResolver;
            _navigationService = new Lazy <INavigationService>(() => _serviceResolver.Resolve <INavigationService>());
        }
Exemplo n.º 6
0
        public VKAdInfoViewModel(
            IVKAdService vkAdService,
            IAppLoaderService appLoaderService,
            ILogService logService)
        {
            _vkAdService      = vkAdService;
            _appLoaderService = appLoaderService;
            _logService       = logService;

            ReloadDataCommand = new DelegateCommand(OnReloadDataCommand);
            ActionCommand     = new DelegateCommand(OnActionCommand);
        }
Exemplo n.º 7
0
        public LocalGenreViewModel(
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IAppLoaderService appLoaderService,
            ILibraryDatabaseService libraryDatabaseService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _libraryDatabaseService = libraryDatabaseService;

            DeleteItemCommand = new DelegateCommand <object>(OnDeleteItemCommand);
        }
Exemplo n.º 8
0
        public VideoPlayerViewModel(INavigationService navigationService, ILocService locService,
                                    IDialogsService dialogsService, IAppLoaderService appLoaderService)
        {
            _navigationService = navigationService;
            _locService        = locService;
            _dialogsService    = dialogsService;
            _appLoaderService  = appLoaderService;

            MediaOpenedCommand = new DelegateCommand(OnMediaOpenedCommand);
            MediaEndedCommand  = new DelegateCommand(OnMediaEndedCommand);
            MediaFailedCommand = new DelegateCommand(OnMediaFailedCommand);
        }
Exemplo n.º 9
0
        public UploadFileViewModel(
            IUploadsServiceHelper uploadsServiceHelper,
            INavigationService navigationService,
            IAppLoaderService appLoaderService)
        {
            _uploadsServiceHelper = uploadsServiceHelper;
            _navigationService    = navigationService;
            _appLoaderService     = appLoaderService;

            SelectFileCommand        = new DelegateCommand(OnSelectFileCommand);
            UploadFileCommand        = new DelegateCommand(OnUploadFileCommand, CanExecuteUploadFileCommand);
            SelectAnotherFileCommand = new DelegateCommand(OnSelectAnotherFileCommand);
        }
Exemplo n.º 10
0
        public UserContentViewModel(
            InTouch inTouch,
            INavigationService navigationService,
            IPlayerService playerService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            IVKLoginService vkLoginService,
            IDialogsService dialogsService,
            ILocService locService,
            IInTouchWrapper inTouchWrapper,
            ILaunchViewResolver launchViewResolver,
            IPurchaseService purchaseService)
        {
            _inTouch                = inTouch;
            _navigationService      = navigationService;
            _playerService          = playerService;
            _downloadsServiceHelper = downloadsServiceHelper;
            _appLoaderService       = appLoaderService;
            _vkLoginService         = vkLoginService;
            _dialogsService         = dialogsService;
            _locService             = locService;
            _inTouchWrapper         = inTouchWrapper;
            _launchViewResolver     = launchViewResolver;
            _purchaseService        = purchaseService;

            SelectedItems  = new List <object>();
            PrimaryItems   = new ObservableCollection <ICommandBarElement>();
            SecondaryItems = new ObservableCollection <ICommandBarElement>();

            ExecuteTracksListItemCommand = new DelegateCommand <object>(OnExecuteTracksListItemCommand);
            NotImplementedCommand        = new DelegateCommand(() => _navigationService.Navigate("AccessDeniedView", null));
            DownloadItemCommand          = new DelegateCommand <object>(OnDownloadItemCommand, CanExecuteDownloadItemCommand);
            ActivateSelectionMode        = new DelegateCommand(SetSelectionMode, CanSelectionMode);
            ReloadContentCommand         = new DelegateCommand(OnReloadContentCommand);
            DownloadSelectedCommand      = new DelegateCommand(OnDownloadSelectedCommand, CanExecuteDownloadSelectedCommand);
            SelectionChangedCommand      = new DelegateCommand(OnSelectionChangedCommand);
            SelectAllCommand             = new DelegateCommand(OnSelectAllCommand, CanSelectionMode);

            AddToMyCollectionCommand         = new DelegateCommand <object>(OnAddToMyCollection, CanAddToMyCollection);
            AddSelectedToMyCollectionCommand = new DelegateCommand(OnAddSelectedToMyCollection, CanAddSelected);
            PlaySelectedCommand = new DelegateCommand(OnPlaySelectedCommand, HasSelectedAudios);
            PlayShuffleCommand  = new DelegateCommand(OnPlayShuffleCommand);

            DeleteCommand         = new DelegateCommand <object>(OnDeleteCommand, CanDelete);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, CanDeleteSelected);

            OpenTransferManagerCommand = new DelegateCommand(OnOpenTransferManagerCommand);
            OpenMainViewCommand        = new DelegateCommand(OnOpenMainViewCommand);

            ShowTrackInfoCommand = new DelegateCommand <Audio>(OnShowTrackInfoCommand);
        }
Exemplo n.º 11
0
        public LastFmLoginViewModel(ILastFmLoginService lastFmLoginService,
                                    IAppLoaderService appLoaderService, IDialogsService dialogsService,
                                    ILocService locService)
        {
            _lastFmLoginService = lastFmLoginService;
            _appLoaderService   = appLoaderService;
            _dialogsService     = dialogsService;
            _locService         = locService;

            JoinCommand = new DelegateCommand(async() => await Launcher.LaunchUriAsync(
                                                  new Uri("https://www.last.fm/join")));
            RestoreCommand = new DelegateCommand(async() => await Launcher.LaunchUriAsync(
                                                     new Uri("https://secure.last.fm/settings/lostpassword")));
        }
Exemplo n.º 12
0
 protected VKAudioImplementedViewModel(
     InTouch inTouch,
     IAppLoaderService appLoaderService,
     IDialogsService dialogsService,
     IInTouchWrapper inTouchWrapper,
     IDownloadsServiceHelper downloadsServiceHelper,
     IPlayerService playerService,
     ILocService locService,
     INavigationService navigationService,
     IPurchaseService purchaseService)
     : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
            playerService, locService, navigationService, purchaseService)
 {
 }
Exemplo n.º 13
0
 public RecommendedViewModel(
     InTouch inTouch,
     INavigationService navigationService,
     IPlayerService playerService,
     IDownloadsServiceHelper downloadsServiceHelper,
     IAppLoaderService appLoaderService,
     IDialogsService dialogsService,
     ILocService locService,
     IInTouchWrapper inTouchWrapper,
     IPurchaseService purchaseService)
     : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
            playerService, locService, navigationService, purchaseService)
 {
     IsReloadButtonSupported = true;
 }
Exemplo n.º 14
0
        protected DownloadableAudioViewModel(
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            int maxPlayingTracks = -1)
            : base(playerService, locService, navigationService, appLoaderService, maxPlayingTracks)
        {
            _downloadsServiceHelper = downloadsServiceHelper;

            DownloadTrackCommand       = new DelegateCommand <T>(OnDownloadTrackCommand, CanDownloadTrack);
            DownloadSelectedCommand    = new DelegateCommand(OnDownloadSelectedCommand, () => HasSelectedItems() & CanDownloadSelected());
            OpenTransferManagerCommand = new DelegateCommand(OnOpenTransferManagerCommand);
        }
Exemplo n.º 15
0
        public CachedViewModel(
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IAppLoaderService appLoaderService,
            IMusicCacheService musicCacheService,
            IDialogsService dialogsService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _musicCacheService = musicCacheService;
            _dialogsService    = dialogsService;

            DeleteTrackCommand    = new DelegateCommand <CachedTrack>(OnDeleteTrackCommand);
            DeleteAllCommand      = new DelegateCommand(OnDeleteAllCommand);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);
        }
Exemplo n.º 16
0
        public VideoSearchViewModel(InTouch inTouch, INavigationService navigationService,
                                    ILocService locService, ISettingsService settingsService, IDialogsService dialogsService,
                                    IAppLoaderService appLoaderService, IInTouchWrapper inTouchWrapper)
            : base(inTouch, navigationService, locService, settingsService, dialogsService, inTouchWrapper)
        {
            _appLoaderService = appLoaderService;

            AddToMyVideosCommand         = new DelegateCommand <Video>(OnAddToMyVideosCommand, CanAddToMyVideos);
            AddSelectedToMyVideosCommand = new DelegateCommand(OnAddSelectedToMyAudiosCommand, HasSelectedItems);

            DeleteCommand             = new DelegateCommand <Video>(OnDeleteCommand, CanDeleteVideo);
            DeleteSelectedCommand     = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);
            ShowFilterFlyoutCommand   = new DelegateCommand(OnShowPerformerFlyoutCommand);
            FilterFlyoutClosedCommand = new DelegateCommand(OnFilterFlyoutClosedCommand);
            CreateFilters();
        }
Exemplo n.º 17
0
        public VideoInfoViewModel(INavigationService navigationService, InTouch inTouch,
                                  IAppLoaderService appLoaderService, ILocService locService,
                                  IVideoLinksExtractor videoLinksExtractor, IDialogsService dialogsService,
                                  IDownloadsServiceHelper downloadsServiceHelper)
        {
            _navigationService      = navigationService;
            _inTouch                = inTouch;
            _appLoaderService       = appLoaderService;
            _locService             = locService;
            _videoLinksExtractor    = videoLinksExtractor;
            _dialogsService         = dialogsService;
            _downloadsServiceHelper = downloadsServiceHelper;

            LoadLinksCommand     = new DelegateCommand(OnLoadLinksCommand);
            PlayVideoCommand     = new DelegateCommand(OnPlayVideoCommand, CanPlayAndDownload);
            DownloadVideoCommand = new DelegateCommand(OnDownloadVideoCommand, CanPlayAndDownload);
        }
Exemplo n.º 18
0
        public LibraryViewModel(
            INavigationService navigationService,
            ILibraryDatabaseService libraryDatabaseService,
            IPlayerService playerService,
            ILogService logService,
            IAppLoaderService appLoaderService,
            ILocService locService,
            IDialogsService dialogsService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _libraryDatabaseService = libraryDatabaseService;
            _logService             = logService;
            _dialogsService         = dialogsService;

            ExecuteItemCommand = new DelegateCommand <object>(OnExecuteItemCommand);
            DeleteItemCommand  = new DelegateCommand <object>(OnDeleteItemCommand);
        }
Exemplo n.º 19
0
        public PlayerViewModel(
            InTouch inTouch,
            IInTouchWrapper inTouchWrapper,
            INavigationService navigationService,
            IPlayerService playerService,
            IPlayerPlaylistService playerPlaylistService,
            IImagesCacheService imagesCacheService,
            ITracksShuffleService tracksShuffleService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            ILastFmLoginService lastFmLoginService,
            IPurchaseService purchaseService,
            ILocService locService,
            IDialogsService dialogsService,
            IAppNotificationsService appNotificationsService,
            ISettingsService settingsService)
            : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
                   playerService, locService, navigationService, purchaseService)
        {
#if DEBUG
            Debug.WriteLine("Вызван конструктор PlayerViewModel.");
#endif

            IsReloadButtonSupported  = false;
            IsShuffleButtonSupported = false;
            IsPlayButtonSupported    = false;

            _playerPlaylistService   = playerPlaylistService;
            _imagesCacheService      = imagesCacheService;
            _tracksShuffleSevice     = tracksShuffleService;
            _lastFmLoginService      = lastFmLoginService;
            _appNotificationsService = appNotificationsService;
            _settingsService         = settingsService;

            _timer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(500)
            };

            NextTrackCommand     = new DelegateCommand(OnNextTrackCommand);
            PreviousTrackCommand = new DelegateCommand(OnPreviosTrackCommand);
            PlayPauseCommand     = new DelegateCommand(OnPlayPauseCommand);
            PlayTrackCommand     = new DelegateCommand <PlayerItem>(OnPlayTrackCommand);
            ShowLyricsCommand    = new DelegateCommand(OnShowLyricsCommand,
                                                       () => CurrentTrack?.Track.VKInfo != null && CurrentTrack.Track.VKInfo.LyricsID != 0);
        }
Exemplo n.º 20
0
        public AudioAlbumViewModel(
            INavigationService navigationService,
            IPlayerService playerService,
            IDownloadsServiceHelper downloadsServiceHelper,
            InTouch inTouch,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            ILocService locService,
            IInTouchWrapper inTouchWrapper,
            IPurchaseService purchaseService)
            : base(inTouch, appLoaderService, dialogsService, inTouchWrapper,
                   downloadsServiceHelper, playerService, locService, navigationService, purchaseService)
        {
            IsReloadButtonSupported = true;

            DeleteAudioCommand    = new DelegateCommand <Audio>(OnDeleteAudioCommand, CanDeleteAudio);
            DeleteSelectedCommand = new DelegateCommand(OnDeleteSelectedCommand, HasSelectedItems);
        }
Exemplo n.º 21
0
        public TrackInfoViewModel(
            INavigationService navigationService,
            InTouch inTouch,
            IInTouchWrapper inTouchWrapper,
            IPlayerService playerService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            ILocService locService,
            IImagesCacheService imagesCacheService,
            IPurchaseService purchaseService)
            : base(inTouch, appLoaderService, dialogsService, inTouchWrapper, downloadsServiceHelper,
                   playerService, locService, navigationService, purchaseService)
        {
            _imagesCacheService = imagesCacheService;

            ShowOtherTracksCommand = new DelegateCommand(OnShowOtherTracksCommand);
        }
Exemplo n.º 22
0
        public DirectAuthViewModel(
            IVKLoginService vkLoginService,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            ILocService locService,
            INavigationService navigationService,
            IVKCaptchaHandler vkCaptchaHandler)
        {
            _vkLoginService    = vkLoginService;
            _appLoaderService  = appLoaderService;
            _dialogsService    = dialogsService;
            _locService        = locService;
            _navigationService = navigationService;
            _vkCaptchaHandler  = vkCaptchaHandler;

            JoinCommand      = new DelegateCommand(async() => await Launcher.LaunchUriAsync(new Uri("https://vk.com/join")));
            RestoreCommand   = new DelegateCommand(async() => await Launcher.LaunchUriAsync(new Uri("https://vk.com/restore")));
            GoToOAuthCommand = new DelegateCommand(OnGoToOAuthCommand);
        }
Exemplo n.º 23
0
        protected VKAudioViewModel(
            InTouch inTouch,
            IAppLoaderService appLoaderService,
            IDialogsService dialogsService,
            IInTouchWrapper inTouchWrapper,
            IDownloadsServiceHelper downloadsServiceHelper,
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IPurchaseService purchaseService)
            : base(downloadsServiceHelper, appLoaderService, playerService, locService, navigationService)
        {
            _inTouch         = inTouch;
            _dialogsService  = dialogsService;
            _inTouchWrapper  = inTouchWrapper;
            _purchaseService = purchaseService;

            AddToMyAudiosCommand         = new DelegateCommand <T>(OnAddToMyAudiosCommand, CanAddToMyAudios);
            AddSelectedToMyAudiosCommand = new DelegateCommand(OnAddSelectedToMyAudiosCommand, () => HasSelectedItems() & CanAddSelectedAudios());
            ShowTrackInfoCommand         = new DelegateCommand <T>(OnShowTrackInfoCommand, CanShowTrackInfo);
        }
Exemplo n.º 24
0
        public VideoAlbumViewModel(INavigationService navigationService, InTouch inTouch,
                                   IAppLoaderService appLoaderService, IDialogsService dialogsService, ILocService locService,
                                   IInTouchWrapper inTouchWrapper)
        {
            _navigationService = navigationService;
            _inTouch           = inTouch;
            _dialogsService    = dialogsService;
            _locService        = locService;
            _appLoaderService  = appLoaderService;
            _inTouchWrapper    = inTouchWrapper;

            PrimaryItems   = new ObservableCollection <ICommandBarElement>();
            SecondaryItems = new ObservableCollection <ICommandBarElement>();

            ReloadContentCommand       = new DelegateCommand(OnReloadContentCommand);
            AddToMyVideosCommand       = new DelegateCommand <Video>(OnAddToMyVideosCommand, CanAddToMyVideos);
            OpenVideoCommand           = new DelegateCommand <Video>(OnOpenVideoCommand);
            OpenTransferManagerCommand = new DelegateCommand(OnOpenTransferManagerCommand);

            DeleteVideoCommand = new DelegateCommand <Video>(OnDeleteVideoCommand, CanDeleteVideo);
        }
Exemplo n.º 25
0
        protected AudioViewModel(ILocService locService,
                                 INavigationService navigationService,
                                 IPlayerService playerService,
                                 IAppLoaderService appLoaderService,
                                 bool isShuffleButtonSupported,
                                 bool isPlayButtonSupported,
                                 int maxPlayingTracks)
            : base(locService)
        {
            _navigationService = navigationService;
            _playerService     = playerService;
            _appLoaderService  = appLoaderService;

            PlayTracksCommand   = new DelegateCommand <T>(OnPlayTracksCommand);
            PlaySelectedCommand = new DelegateCommand(OnPlaySelectedCommand, HasSelectedItems);
            PlayShuffleCommand  = new DelegateCommand(OnPlayShuffleCommand);

            _maxPlayingTracks        = maxPlayingTracks;
            IsShuffleButtonSupported = isShuffleButtonSupported;
            IsPlayButtonSupported    = isPlayButtonSupported;
        }
Exemplo n.º 26
0
 public PlayerViewModel(
     InTouch inTouch,
     IInTouchWrapper inTouchWrapper,
     INavigationService navigationService,
     IPlayerService playerService,
     IPlayerPlaylistService playerPlaylistService,
     IImagesCacheService imagesCacheService,
     ITracksShuffleService tracksShuffleService,
     IDownloadsServiceHelper downloadsServiceHelper,
     IAppLoaderService appLoaderService,
     ILastFmLoginService lastFmLoginService,
     IPurchaseService purchaseService,
     ILocService locService,
     IDialogsService dialogsService,
     IAppNotificationsService appNotificationsService,
     ISettingsService settingsService,
     IEventAggregator eventAggregator)
     : this(inTouch, inTouchWrapper, navigationService, playerService, playerPlaylistService, imagesCacheService,
            tracksShuffleService, downloadsServiceHelper, appLoaderService, lastFmLoginService, purchaseService,
            locService, dialogsService, appNotificationsService, settingsService)
 {
     _eventAggregator = eventAggregator;
 }