Exemplo n.º 1
0
        private async Task SelectedChangedAsync(Event _event)
        {
            if (SelectedEvents.All(e => e != _event))
            {
                foreach (var report in Reports.ToArray())
                {
                    if (report.Event.Id == _event.Id)
                    {
                        Reports.Remove(report);
                    }
                }
                foreach (var Hit in Hits.ToArray())
                {
                    if (Hit.Event.Id == _event.Id)
                    {
                        Hits.Remove(Hit);
                    }
                }
            }
            else
            {
                var reports = await MapModel.GetReports(_event.Id);

                var hits = await MapModel.GetHits(_event.Id);

                foreach (var report in reports)
                {
                    Reports.Add(report);
                }
                foreach (var hit in hits)
                {
                    Hits.Add(hit);
                }
            }
            OnPropertyChanged(nameof(LocationList));
        }