Exemplo n.º 1
0
        public MyIncidentsViewModel()
        {
            Title                = "Mes incidents";
            Incidents            = new ObservableCollection <Incident>();
            LoadIncidentsCommand = new Command(async() => await ExecuteLoadIncidentsCommand());

            MessagingCenter.Subscribe <NewIncidentPage, Incident>(this, "AddIncident", async(obj, incident) =>
            {
                var _incident = incident as Incident;
                Incidents.Add(_incident);
                await DataStore.AddIncidentAsync(_incident);
            });
        }