This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IStartupTask | |
{ | |
Task<bool> CanRunAsync(); | |
Task RunAsync(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class User | |
{ | |
public User(string firstName) | |
{ | |
if (firstName == null) | |
throw new ArgumentNullException(nameof(firstName), "First name cannot be null."); | |
if (firstName.Length == 0) | |
throw new ArgumentException("First name cannot be empty.", nameof(firstName)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UberClone.ViewModels | |
{ | |
public class MapPageViewModel : INotifyPropertyChanged | |
{ | |
... | |
public MapPageViewModel() | |
{ | |
var _stateMachine = new StateMachine<XUberState, XUberTrigger>(XUberState.Initial); | |
CalculateRouteTrigger = _stateMachine.SetTriggerParameters<GooglePlaceAutoCompletePrediction>(XUberTrigger.CalculateRoute); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="UberClone.Views.MapPage" > | |
<Grid RowSpacing="0" | |
x:Name="layout" | |
VerticalOptions="FillAndExpand" | |
RowDefinitions="Auto, *"> | |
... | |
<local:SearchContentView IsVisible="false" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UberClone.ViewModels | |
{ | |
public class MapPageViewModel : INotifyPropertyChanged | |
{ | |
public XUberState State { get; private set; } | |
public ICommand FireTriggerCommand { get; } | |
private readonly StateMachine<XUberState, XUberTrigger> _stateMachine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage | |
x:Class="VideoPlayerStateMachine.MainPage" | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:controls="clr-namespace:VideoPlayerStateMachine.Controls" | |
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" | |
xmlns:local="clr-namespace:VideoPlayerStateMachine" | |
xmlns:viewModels="clr-namespace:VideoPlayerStateMachine.ViewModels" | |
BackgroundColor="Black" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainViewModel : INotifyPropertyChanged | |
{ | |
public MainViewModel() | |
{ | |
_videoPlayerStateMachine.Configure(VideoState.Playing) | |
.OnActivate(OnStateEntry) | |
.OnEntry(OnStateEntry) | |
.PermitReentryIf(VideoTrigger.Forward) | |
.PermitReentryIf(VideoTrigger.Rewind) | |
.Permit(VideoTrigger.Pause, VideoState.Paused) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainViewModel : INotifyPropertyChanged | |
{ | |
public MainViewModel() | |
{ | |
var forwardParamTrigger = _videoPlayerStateMachine.SetTriggerParameters<double>(VideoTrigger.Forward); | |
var rewindParamTrigger = _videoPlayerStateMachine.SetTriggerParameters<double>(VideoTrigger.Rewind); | |
... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainViewModel : INotifyPropertyChanged | |
{ | |
... | |
public ICommand ForwardCommand { get; } | |
public ICommand RewindCommand { get; } | |
public MainViewModel(){ | |
... | |
ForwardCommand = new Command<double>((seconds) => { |