public override IEnumerable <ICommand> GetMenuCommands() { yield return(new ActionCommand( IsAnyTimerRunning ? "Stop auto-play" : "Start auto-play", () => { // Send the command, which will toggle our hasRemoteAutoTimer via the ExecuteCommand handler. Orchestrator.BroadcastViewCommand(InformAutoTimerCommand, !IsAnyTimerRunning); // If we just turned the timer on, start the time in our local instance only, after the command callback. if (IsAnyTimerRunning) { autoTimer.Start(); } // If we just turned the timer off, the ExecuteCommand handler in whichever view started the // timer will turn its timer off, so we don't need to do anything here. } )); yield return(new ActionCommand("Start over", () => BroadcastNavigateTo(0))); }
void SetState(int?videoIndex = null, TimeSpan?position = null, bool?isPlaying = null) { orchestrator.BroadcastViewCommand(SetStateCommand, videoIndex ?? VideoIndex, (position ?? Position).Ticks, isPlaying ?? IsPlaying); }
void SetMessage(string message) { Orchestrator.BroadcastViewCommand(SetMessageCommand, message); }