Exemplo n.º 1
0
        public SettingsViewModel(
            INavigationService navigationService,
            IVKLoginService vkLoginService,
            ISettingsService settingsService,
            ILastFmLoginService lastFmLoginSevice,
            ILocService locService,
            IDialogsService dialogsService,
            IInTouchWrapper inTouchWrapper,
            InTouch inTouch,
            ILaunchViewResolver launchViewResolver,
            INotificationsService notificationsService)
        {
            _navigationService    = navigationService;
            _vkLoginService       = vkLoginService;
            _settingsService      = settingsService;
            _lastFmLoginService   = lastFmLoginSevice;
            _inTouchWrapper       = inTouchWrapper;
            _inTouch              = inTouch;
            _locService           = locService;
            _dialogsService       = dialogsService;
            _launchViewResolver   = launchViewResolver;
            _notificationsService = notificationsService;

            Authorizations            = new ObservableCollection <IServiceAuthorization>();
            UpdateDatabaseCommand     = new DelegateCommand(OnUpdateDatabaseCommand);
            ExtractMp3FromVksmCommand = new DelegateCommand(OnExtractMp3FromVksmCommand);
        }
Exemplo n.º 2
0
        private void LastFmLoginService_UserLogout(ILastFmLoginService sender, EventArgs e)
        {
            var item = Authorizations.FirstOrDefault(s => s.ServiceName == "last.fm");

            if (item == null)
            {
                return;
            }

            Authorizations.Remove(item);
            Authorizations.Add(_lastFmLoginService.GetServiceAuthorization());
        }
Exemplo n.º 3
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.º 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);
        }
Exemplo n.º 5
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;
 }