Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created January 12, 2022 20:39
Show Gist options
  • Save rdelrosario/ca2f35e4271166ec8d9a1f5f7cfdd711 to your computer and use it in GitHub Desktop.
Save rdelrosario/ca2f35e4271166ec8d9a1f5f7cfdd711 to your computer and use it in GitHub Desktop.
public class MapPageViewModel : INotifyPropertyChanged
{
public MapPageViewModel()
{
var _stateMachine = new StateMachine<XUberState, XUberTrigger>(XUberState.Initial);
_stateMachine.Configure(XUberState.Initial)
.OnEntry(Initialize)
.OnExit(() => { Places = new ObservableCollection<GooglePlaceAutoCompletePrediction>(RecentPlaces); })
.OnActivateAsync(GetActualUserLocation)
.Permit(XUberTrigger.ChooseDestination, XUberState.SearchingDestination)
.Permit(XUberTrigger.CalculateRoute, XUberState.CalculatingRoute);
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment