Esempio n. 1
0
        private async void OnClearAllClicked(object sender, EventArgs e)
        {
            activityIndicator.IsRunning = true;

            CrimeFilterer.IncidentTypeFilter = "None";

            var incidents = await CrimeFilterer.Filter();

            listView.ItemsSource = incidents;

            numOfIncidentsLabel.Text = "0 Incidents";

            activityIndicator.IsRunning = false;
        }
Esempio n. 2
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            activityIndicator.IsRunning = true;

            var incidents = (await CrimeFilterer.Filter()).ToArray();

            for (int i = 0; i < incidents.Length; i++)
            {
                Incident incident = incidents[i];

                // Set visual properties for incidents
                incident.Icon         = IncidentTypeInfo.GetIncidentIcon(incident.Type);
                incident.StandardTime = Convert.ToDateTime(incident.Time).ToString("dddd, dd MMMM yyyy");
            }

            listView.ItemsSource = incidents;

            activityIndicator.IsRunning = false;

            numOfIncidentsLabel.Text  = $"{incidents.Length} Incidents";
            InfoFrame.BackgroundColor = IncidentTypeInfo.GetIncidentColor();
        }