void SetManual() { if (currentLock == PlayerStats.MAX_LOCK_LEVEL - 1) { nextButton.interactable = false; } else { nextButton.interactable = true; } if (currentLock == 0) { previousButton.interactable = false; } else { previousButton.interactable = true; } if (PlayerStats.instance != null) { textHeader.text = ManualCommand.GetLockManualTitle(currentLock); if (PlayerStats.instance.GetHasLockLevel(currentLock)) { textBody.text = ManualCommand.GetLockManualDescription(currentLock); } else { textBody.text = "You do not own this manual. Please purchase it in order to view."; } } }
public TagsTabViewModel() { HeaderInfo = new HeaderInfo { Title = "Tags", IsSelectedAction = isSelected => { if (!Tags.Any() && isSelected) { GetTags(); } } }; _mixes = new ObservableCollection <Mix>(); _tags = new ObservableCollection <Tag>(); _selectedTags = new ObservableCollection <Tag>(); _ui = TaskScheduler.FromCurrentSynchronizationContext(); ToggleTagCommand = new StaticCommand <Tag>(ExecuteToggleTag); ToggleTagFilterCommand = new StaticCommand <string>(ExecuteToggleTagFilter); GoToNextPageCommand = new ManualCommand(ExecuteGoToNextPage, CanExecuteGoToNextPage); GoToPreviousPageCommand = new ManualCommand(ExecuteGoToPreviousPage, CanExecuteGoToPreviousPage); GoToNextTagPageCommand = new ManualCommand(ExecutGoToNextTagPage, CanExecuteGoToNextTagPage); GoToPreviousTagPageCommand = new ManualCommand(ExecuteGoToPreviousTagPage, CanExecuteGoToPreviousTagPage); PlayMixCommand = new StaticCommand <Mix>(ExecutePlayMix); QueueMixCommand = new StaticCommand <Mix>(ExecuteQueueMix); }
public ControlsViewModel( IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher, IToastService toastService, ILoggerFacade logger) { _radio = radio; _radio.CurrentTrackChanged += RadioOnCurrentTrackChanged; _radio.UpcomingTrackChanged += RadioOnUpcomingTrackChanged; _radio.CurrentTrackStreamChanged += RadioOnCurrentTrackStreamChanged; _radio.TrackStreamQueued += RadioOnTrackStreamQueued; _player = player; _dispatcher = dispatcher; _toastService = toastService; _logger = logger; _player.IsPlayingChanged += (sender, args) => { RaisePropertyChanged("IsPlaying"); RefreshCommands(); }; NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand <Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand <Track>(ExecuteShareTrack, CanExecuteShareTrack); }
public NowPlayingViewModel(IRadio radio, [Import("CorePlayer")] ITrackPlayer player, Dispatcher dispatcher) { _radio = radio; _player = player; _dispatcher = dispatcher; _random = new Random(); _taskScheduler = TaskScheduler.FromCurrentSynchronizationContext(); NavigateBackCommand = new AutomaticCommand(ExecuteNavigateBack, CanExecuteNavigateBack); NextTrackCommand = new ManualCommand(ExecuteNextTrack, CanExecuteNextTrack); TogglePlayPauseCommand = new ManualCommand(ExecuteTogglePlayPause, CanExecuteTogglePlayPause); ShareTrackCommand = new ManualCommand<Track>(ExecuteShareTrack, CanExecuteShareTrack); }
protected MixListViewModel() { _ui = TaskScheduler.FromCurrentSynchronizationContext(); _mixes = new ObservableCollection <Mix>(); _tagFilterList = new ObservableCollection <string>(); _tags = new ObservableCollection <string>(); _deferredSearchTimer = new Timer(750); _deferredSearchTimer.Elapsed += OnDeferredSearchTimerTick; ToggleTagFilterCommand = new StaticCommand <string>(ExecuteToggleTagFilter); PlayMixCommand = new StaticCommand <Mix>(ExecutePlayMix); QueueMixCommand = new StaticCommand <Mix>(ExecuteQueueMix); GoToNextPageCommand = new ManualCommand(ExecuteGoToNextPage, CanExecuteGoToNextPage); GoToPreviousPageCommand = new ManualCommand(ExecuteGoToPreviousPage, CanExecuteGoToPreviousPage); }
public static void SendCommand(ManualCommand command) { Message m = new Message(Message.SendType.MANUAL_COMMAND, new Byte[1] { (byte)command }); SendMessage(m); }