Пример #1
0
        public VKAudioInfoViewModel(
            IHttpFileService httpFileService,
            IImagesCacheService imagesCacheService)
        {
            _httpFileService    = httpFileService;
            _imagesCacheService = imagesCacheService;

            ReloadInfoCommand = new DelegateCommand(LoadTrackInfo);
        }
Пример #2
0
        public LocalArtistViewModel(
            IPlayerService playerService,
            ILocService locService,
            INavigationService navigationService,
            IAppLoaderService appLoaderService,
            ILibraryDatabaseService libraryDatabaseService,
            IImagesCacheService imagesCacheService)
            : base(playerService, locService, navigationService, appLoaderService)
        {
            _libraryDatabaseService = libraryDatabaseService;
            _imagesCacheService     = imagesCacheService;

            DeleteItemCommand = new DelegateCommand <object>(OnDeleteItemCommand);
        }
Пример #3
0
        public ArtistAlbumViewModel(
            LastfmClient lfClient,
            INavigationService navigationService,
            ISettingsService settingsService,
            IImagesCacheService imagesCacheService,
            ILocService locService)
        {
            _lfClient           = lfClient;
            _navigationService  = navigationService;
            _settingsService    = settingsService;
            _imagesCacheService = imagesCacheService;
            _locService         = locService;

            GoToTrackInfoCommand  = new DelegateCommand <LastTrack>(OnGoToTrackInfoCommand);
            FindArtistInVKCommand = new DelegateCommand(OnFindArtistInVKCommand);
            ReloadAlbumCommand    = new DelegateCommand(OnReloadAlbumCommand);
        }
Пример #4
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);
        }
Пример #5
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);
        }
Пример #6
0
        public ArtistInfoViewModel(
            LastfmClient lfClient,
            INavigationService navigationService,
            ISettingsService settingsService,
            IPurchaseService purchaseService,
            IImagesCacheService imagesCacheService)
        {
            _lfClient           = lfClient;
            _navigationService  = navigationService;
            _settingsService    = settingsService;
            _purchaseService    = purchaseService;
            _imagesCacheService = imagesCacheService;

            GoToTrackInfoCommand         = new DelegateCommand <LastTrack>(OnGoToTrackInfoCommand);
            GoToSimilarArtistInfoCommand = new DelegateCommand <LastArtist>(OnGoToSimilarArtistInfoCommand);
            GoToAlbumInfoCommand         = new DelegateCommand <LastAlbum>(OnGoToAlbumInfoCommand);
            FindArtistInVKCommand        = new DelegateCommand(OnFindArtistInVKCommand);
        }
Пример #7
0
        public MainViewModel(
            InTouch inTouch,
            LastfmClient lfClient,
            IInTouchWrapper inTouchWrapper,
            INavigationService navigationService,
            IPurchaseService purchaseService,
            IPlayerService playerService,
            IDownloadsServiceHelper downloadsServiceHelper,
            IImagesCacheService imagesCacheService,
            IAdsService adsService)
        {
            _inTouch                = inTouch;
            _lfClient               = lfClient;
            _inTouchWrapper         = inTouchWrapper;
            _navigationService      = navigationService;
            _purchaseService        = purchaseService;
            _playerService          = playerService;
            _downloadsServiceHelper = downloadsServiceHelper;
            _imagesCacheService     = imagesCacheService;
            _adsService             = adsService;

            GoToTrackInfoCommand         = new DelegateCommand <LastTrack>(OnGoToTrackInfoCommand);
            GoToArtistInfoCommand        = new DelegateCommand <LastArtist>(OnGoToArtistInfoCommand);
            GoToTopTracksCommand         = new DelegateCommand(OnGoToTopTracksCommand);
            GoToTopArtistsCommand        = new DelegateCommand(OnGoTopArtistsCommand);
            GoToUserContentCommand       = new DelegateCommand <string>(OnGoToUserContentCommand);
            GoToUserCommCommand          = new DelegateCommand <string>(OnGoToUserCommCommand);
            GoToTransferViewCommand      = new DelegateCommand <string>(OnGoToTransferViewCommand);
            GoToAboutViewCommand         = new DelegateCommand(OnGoToAboutViewCommand);
            GoToRecommendedViewCommand   = new DelegateCommand(OnGoToRecommendedViewCommand);
            GoToPlayerViewCommand        = new DelegateCommand(OnGoToPlayerViewCommand);
            PlayRecommendedTracksCommand = new DelegateCommand <Audio>(OnPlayRecommendedTracksCommand);
            PlayUserTracksCommand        = new DelegateCommand <Audio>(OnPlayUserTracksCommand);
            DownloadTrackCommand         = new DelegateCommand <Audio>(OnDownloadTrackCommand);
            GoToSearchCommand            = new DelegateCommand(OnGoToSearchCommand);
            GoToSettingsViewCommand      = new DelegateCommand(OnGoToSettingsViewCommand);
            GoToNewsViewCommand          = new DelegateCommand(OnGoToNewsViewCommand);
            GoToLibraryViewCommand       = new DelegateCommand <string>(OnGoToLibraryViewCommand);
            GoToUploadFileViewCommand    = new DelegateCommand(OnGoToUploadFileViewCommand);
            GoToPopularVKViewCommand     = new DelegateCommand(OnGoToPopularVKViewCommand);

            NotImplementedCommand = new DelegateCommand(() => _navigationService.Navigate("AccessDeniedView", null));
        }
Пример #8
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;
 }
Пример #9
0
        public UwpPlayerService(
            ILogService logService,
            IPlayerPlaylistService playerPlaylistService,
            ITracksShuffleService tracksShuffleService,
            ISettingsService settingsService,
            IEventAggregator eventAggregator,
            IMusicCacheService musicCacheService,
            IImagesCacheService imagesCacheService)
        {
            _logService            = logService;
            _playerPlaylistService = playerPlaylistService;
            _tracksShuffleService  = tracksShuffleService;
            _settingsService       = settingsService;
            _eventAggregator       = eventAggregator;
            _imagesCacheService    = imagesCacheService;

            CurrentPlayer = new MediaPlayer();
            CurrentPlayer.CommandManager.IsEnabled = false;
            _manager = new PlaybackManager(CurrentPlayer, _settingsService, _playerPlaylistService, _logService, musicCacheService);

            _controls = CurrentPlayer.SystemMediaTransportControls;
            _controls.ButtonPressed += Controls_ButtonPressed;
        }
 public InitImagesCacheHostedService(IImagesCacheService imagesCacheService)
 {
     _imagesCacheService = imagesCacheService;
 }
Пример #11
0
 public ImagesService(IImagesCacheService imagesCacheService)
 {
     _imagesCacheService = imagesCacheService;
 }