Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created August 12, 2021 16:05
Show Gist options
  • Save rdelrosario/4e32c7c9ce9777c5b68e29bda4d2fe8d to your computer and use it in GitHub Desktop.
Save rdelrosario/4e32c7c9ce9777c5b68e29bda4d2fe8d to your computer and use it in GitHub Desktop.
public class MainViewModel
{
public ICommand TriggerCommand { get; }
public ICommand VideoActionCommand { get; set; }
public MainViewModel()
{
...
TriggerCommand = new Command<VideoTrigger>(OnTrigger);;
}
private void OnTrigger(VideoTrigger videoTrigger)
{
if (_videoPlayerStateMachine.CanFire(videoTrigger))
{
VideoActionCommand?.Execute(videoTrigger);
_videoPlayerStateMachine.Fire(videoTrigger);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment