public EventViewModel(IMyNavigationService navigationService) { this.navigationService = navigationService; var database = new EventDatabase (); NewEventCommand = new Command (() => this.navigationService.NavigateTo (ViewModelLocator.EventPageKey)); SaveEventCommand = new Command (() => { database.InsetOrUpdateEvent (new Event (EventName, EventTime, EventDate, EventLocation, EventAttendees, IsPublic, GuestCanInvite)); navigationService.GoBack (); }); }
public async void OnAppearing() { var database = new EventDatabase (); EventList = new ObservableCollection<Event> (await database.GetAll ()); }