private async Task OnUserArrivedToDestination()
        {
            IncidentModel currentIncident = FormsMap.Incidents?.FirstOrDefault(i => i.Id == CurrentUserStatus.AttendingIncidentId);

            CurrentUserStatus.IsNavigating = false;

            if (currentIncident == null)
            {
                return;
            }

            // set incident as selected
            if (FormsMap.CurrentIncident?.Id != CurrentUserStatus.AttendingIncidentId)
            {
                FormsMap.CurrentIncident = null;
                FormsMap.CurrentIncident = currentIncident;
            }

            // display identify button on the UI
            currentIncident.ReadyToIdentify = CurrentUserStatus.IsAttendingAnIncident = true;

            // disable informationPanel
            PushpinManager.HideIncidentInformationPanel();

            // call search-area api to fetch the polygon and the related tickets
            IIncidentsService incidentsService = ViewModelLocator.Instance.Resolve <IIncidentsService>();

            currentIncident.SearchArea = await incidentsService.GetSearchAreaForIncidentAsync(currentIncident.Id);

            // Draw search polygon
            if (currentIncident.SearchArea?.Polygon?.Any() == true)
            {
                var polygonData = currentIncident.SearchArea.Polygon;
                DrawSearchAreaPolygon(polygonData);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("No search area defined for current incident");
            }

            // Draw near tickets
            if (currentIncident.SearchArea?.Tickets?.Any() == true)
            {
                var handler = LoadTicketsRequest;
                handler?.Invoke(this, currentIncident.SearchArea.Tickets);
            }

            // Clear navigation
            RouteManager.ClearAllUserRoutes();

            // Disable interaction with rest of incidents
            PushpinManager.SetInteraction(false);
            FormsMap.IsForceNavigation = false;

            // Center and zoom map
            FormsMap.SetPosition(currentIncident.GeoLocation, Distance.FromMiles(1));
        }
Exemplo n.º 2
0
        public MainViewModel(
            IResponderService responderService, IAuthenticationService authenticationService,
            IIncidentsService incidentsService, IHeatmapService heatmapService)
        {
            _responderService = responderService;
            _heatmapService   = heatmapService;

            IncidentToggleButtonChecked  = true;
            ResponderToggleButtonChecked = false;

            _incidentListViewModel   = new IncidentListViewModel(incidentsService);
            _responderListViewModel  = new ResponderListViewModel(_responderService);
            _incidentDetailViewModel = new IncidentDetailViewModel();

            MessagingCenter.Subscribe <IncidentModel>(this, MessengerKeys.NavigateToCurrentIncident, (incident) => ForceNavigation = true);
        }
Exemplo n.º 3
0
 public IncidentListViewModel(IIncidentsService incidentsService)
 {
     _incidentsService = incidentsService;
 }
Exemplo n.º 4
0
 public LUISDialog(IIncidentsService incidentsService, CommonResponsesDialog commonResponsesDialog)
 {
     this.incidentsService      = incidentsService;
     this.commonResponsesDialog = commonResponsesDialog;
 }
Exemplo n.º 5
0
 public IncidentsController(IIncidentsService incidentsService)
 {
     mIncidentsService = incidentsService;
 }
 public IncidentsController(IIncidentsService incidentsService)
 {
     mIncidentsService = incidentsService;
 }
Exemplo n.º 7
0
 public IncidentsController(IIncidentsService incidentsService, IMapper mapper)
 {
     _incidentsService = incidentsService;
     _mapper           = mapper;
 }