Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PreviousButtonViewModel"/> class.
 /// </summary>
 /// <param name="appSettings">The app settings.</param>
 /// <param name="dialogService">The dialog service.</param>
 /// <param name="audioSession">The audio session.</param>
 /// <param name="messageBus">The message bus.</param>
 public PreviousButtonViewModel(IAppSettings appSettings, IDialogService dialogService, IAudioSession audioSession, IMessageBus messageBus)
     : base(appSettings.CurrentProfile.PreviousButton, dialogService, messageBus)
 {
     _appSettings  = appSettings;
     _audioSession = audioSession;
     _appSettings.ProfileChanged += AppsSettingsOnProfileChanged;
     PreviousTrackCommand         = new AsyncRelayCommand <object>(PreviousTrackCommandOnExecute);
     Content = new ButtonContentViewModel(Model.Content, new PreviousButton().Content, dialogService);
     TrackContentViewModel(Content);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="PlayPauseButtonViewModel"/> class.
        /// </summary>
        /// <param name="appSettings">App settings.</param>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="audioSession">The audio session.</param>
        /// <param name="messageBus">The message bus.</param>
        public PlayPauseButtonViewModel(IAppSettings appSettings, IDialogService dialogService, IAudioSession audioSession, IMessageBus messageBus)
            : base(appSettings.CurrentProfile.PlayPauseButton, dialogService, messageBus)
        {
            _appSettings  = appSettings;
            _audioSession = audioSession;
            _audioSession.PropertyChanged += AudioSessionOnPropertyChanged;
            _appSettings.ProfileChanged   += AppSettingsOnProfileChanged;
            PlayPauseTrackCommand          = new AsyncRelayCommand <object>(PlayPauseTrackCommandOnExecute);

            var resetBase = new PlayPauseButton();

            PlayContent  = new ButtonContentViewModel(Model.PlayContent, resetBase.PlayContent, dialogService);
            PauseContent = new ButtonContentViewModel(Model.PauseContent, resetBase.PauseContent, dialogService);
            TrackContentViewModel(PlayContent);
            TrackContentViewModel(PauseContent);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShuffleModeButtonViewModel"/> class.
        /// </summary>
        /// <param name="appSettings">The app settings.</param>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="audioSession">The audio session.</param>
        /// <param name="messageBus">The message bus.</param>
        public ShuffleModeButtonViewModel(IAppSettings appSettings, IDialogService dialogService, IAudioSession audioSession, IMessageBus messageBus)
            : base(appSettings.CurrentProfile.ShuffleModeButton, dialogService, messageBus)
        {
            _appSettings  = appSettings;
            _audioSession = audioSession;
            _audioSession.PropertyChanged += AudioSessionOnPropertyChanged;
            _appSettings.ProfileChanged   += AppSettingsOnProfileChanged;

            ToggleShuffleCommand = new AsyncRelayCommand <object>(ToggleShuffleCommandOnExecute);
            var resetBase = new ShuffleModeButton();

            ShuffleOnContent  = new ButtonContentViewModel(Model.ShuffleOnContent, resetBase.ShuffleOnContent, dialogService);
            ShuffleOffContent = new ButtonContentViewModel(Model.ShuffleOffContent, resetBase.ShuffleOffContent, dialogService);
            TrackContentViewModel(ShuffleOnContent);
            TrackContentViewModel(ShuffleOffContent);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RepeatModeButtonViewModel"/> class.
        /// </summary>
        /// <param name="appSettings">The app settings.</param>
        /// <param name="dialogService">The dialog service.</param>
        /// <param name="audioSession">The audio session.</param>
        /// <param name="messageBus">The message bus.</param>
        public RepeatModeButtonViewModel(IAppSettings appSettings, IDialogService dialogService, IAudioSession audioSession, IMessageBus messageBus)
            : base(appSettings.CurrentProfile.RepeatModeButton, dialogService, messageBus)
        {
            _appSettings  = appSettings;
            _audioSession = audioSession;
            _audioSession.PropertyChanged += AudioSessionOnPropertyChanged;
            _appSettings.ProfileChanged   += AppSettingsOnProfileChanged;

            var resetState = new RepeatModeButton();

            RepeatOffContent       = new ButtonContentViewModel(Model.RepeatOffContent, resetState.RepeatOffContent, dialogService);
            RepeatContextContent   = new ButtonContentViewModel(Model.RepeatContextContent, resetState.RepeatContextContent, dialogService);
            RepeatTrackContent     = new ButtonContentViewModel(Model.RepeatTrackContent, resetState.RepeatTrackContent, dialogService);
            CycleRepeatModeCommand = new AsyncRelayCommand <object>(CycleRepeatModeCommandOnExecute);

            TrackContentViewModel(RepeatOffContent);
            TrackContentViewModel(RepeatContextContent);
            TrackContentViewModel(RepeatTrackContent);
        }