public ShowMeetingPopupPage(Xamarin.Forms.GoogleMaps.Pin pin, Xamarin.Forms.GoogleMaps.Map map) { InitializeComponent(); this.pin = pin; this.map = map; user = repo.GetUserById(int.Parse(Preferences.Get("id", ""))); meeting_Id = -1; int pin_Id = -1; bool alreadyIn = false; foreach (Pin p in repo.GetAllPins()) { if (p.Latitude == pin.Position.Latitude && p.Longitude == pin.Position.Longitude) { pin_Id = p.Id; } } foreach (Meeting m in repo.GetAllMeetings()) { if (pin_Id != -1 && m.Pin_Id == pin_Id) { meeting_Id = m.Id; met = m; } } foreach (UserMeeting um in repo.GetAllUserMeetings()) { if (um.User_Id == user.Id && um.Meeting_Id == meeting_Id) { alreadyIn = true; } } if (alreadyIn) { AcceptButton.IsEnabled = false; CancelButton.Text = "Reject"; } else { AcceptButton.IsEnabled = true; CancelButton.Text = "Cancel"; } InitializeView(repo.GetMeetingById(meeting_Id)); }
//Constructor public HomePageModel() { map = new Xamarin.Forms.GoogleMaps.Map(); AddTrash = new Command(addnewtrash); trashbool = false; locations = new List <Bin> { new Bin { longit = -4.294466, lat = 55.873912, isFull = "empty", colorID = 1 }, new Bin { longit = -4.295075, lat = 55.874898, isFull = "empty", colorID = 2 }, new Bin { longit = -4.293517, lat = 55.873496, isFull = "empty", colorID = 3 }, new Bin { longit = -4.294257, lat = 55.872759, isFull = "empty", colorID = 4 }, new Bin { longit = -4.291435, lat = 55.872711, isFull = "full", colorID = 0 }, new Bin { longit = -4.288570, lat = 55.873078, isFull = "empty", colorID = 6 }, new Bin { longit = -4.286134, lat = 55.874011, isFull = "full", colorID = 0 }, new Bin { longit = -4.283688, lat = 55.873686, isFull = "empty", colorID = 1 }, new Bin { longit = -4.286724, lat = 55.873536, isFull = "empty", colorID = 4 }, new Bin { longit = -4.287175, lat = 55.877081, isFull = "empty", colorID = 3 } }; }