public RaceMainPage(GlobalModel model) { var grid = new Grid(); grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(2) }); grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(UIConfiguration.PanelWidth) }); grid.ColumnSpacing = 0; grid.RowSpacing = 0; grid.Children.Add(new LeftPanelBuilder(model).Build(), 0, 0); grid.Children.Add(new BoxView() { Color = UIConfiguration.ButtonColor, WidthRequest = 2, HeightRequest = -1 }, 1, 0); grid.Children.Add(new RightPanelBuilder(model).Build(), 2, 0); Content = grid; BackgroundColor = Color.Black; MessagingHub.Subscribe <GlobalCommand>(this, QueueType.AskConfirmation, (cmd) => ProcessCommand(cmd)); MessagingHub.Subscribe <string>(this, QueueType.Gesture, (msg) => ShowMessage(msg)); //Navigation.PushModalAsync(cp); }
public GlobalModel() { Numpad = new NumpadModel(); Race = new Race(); Numpad.NewDataTextEntered += Race.ParseAndAddNewSegments; CountersGroup = new CountersContainer(this); CountersGroup.Init(); ShowDebugInfo = true; MessagingHub.Subscribe <GlobalCommand>(this, QueueType.Click, (cmd) => ProcessClickCommand(cmd)); MessagingHub.Subscribe <GlobalCommand>(this, QueueType.Confirmed, (cmd) => ProcessConfirmedCommand(cmd)); MessagingHub.Subscribe <GlobalCommand>(this, QueueType.Canceled, (cmd) => ProcessCanceledCommand(cmd)); MessagingHub.Subscribe <LocationData>(this, QueueType.Location, (loc) => ProcessNewLocation(loc)); InitSpeech(); UseBadLanguage = false; }
public LocationService(LocationManager manager) { _locationManager = manager; MessagingHub.Subscribe <GlobalCommand>(this, QueueType.Global, (cmd) => ProcessCommand(cmd)); }
public VibrationService(Vibrator vibrationService) { vibrator = vibrationService; MessagingHub.Subscribe <VibrateCommand>(this, (cmd) => ProcessCommand(cmd)); }
public void Init() { MessagingHub.Subscribe <LocationData>(this, QueueType.Location, (loc) => ProcessNewLocation(loc)); MessagingHub.Subscribe <RaceEvent>(this, QueueType.Race, (evt) => ProcessRaceEvent(evt)); serializer = new XmlSerializer(typeof(GPX)); }