Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public LocationService(LocationManager manager)
 {
     _locationManager = manager;
     MessagingHub.Subscribe <GlobalCommand>(this, QueueType.Global, (cmd) => ProcessCommand(cmd));
 }
Ejemplo n.º 4
0
 public VibrationService(Vibrator vibrationService)
 {
     vibrator = vibrationService;
     MessagingHub.Subscribe <VibrateCommand>(this, (cmd) => ProcessCommand(cmd));
 }
Ejemplo n.º 5
0
 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));
 }