private void findEventBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { //Send Active User to FindEvent Page FindEvent myFindEvent = new FindEvent("default"); myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); //Navigate to FindEvent Page this.NavigationService.Navigate(myFindEvent); }
// Next button logic private void nextEventBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (aList.Count <= 0) { } else { // If cycle counter is greater than array size reset to 0 if (cycle >= aList.Count) { cycle = 0; } //Get image that matches event group switch (aList[cycle].getGroup) { case "Sport": { infoBox.Source = new BitmapImage(new Uri("images/sportInfoBox.png", UriKind.Relative)); break; } case "Food": { infoBox.Source = new BitmapImage(new Uri("images/foodInfoBox.png", UriKind.Relative)); break; } case "Other": { infoBox.Source = new BitmapImage(new Uri("images/otherInfoBox.png", UriKind.Relative)); break; } case "Entertainment": { infoBox.Source = new BitmapImage(new Uri("images/entertainmentInfoBox.png", UriKind.Relative)); break; } } myMap.Center = new Location(aList[cycle].getLatitude + .006, aList[cycle].getLongitude); //Check description length and change font size if too long if (aList[cycle].getDescription.Length > 120) { eventDescriptionTb.FontSize = 18; } else { eventDescriptionTb.FontSize = 21; } //Update labels with event info eventNameLbl.Content = aList[cycle].getName; eventSubtitleLbl.Content = aList[cycle].getSubtitle; eventDescriptionTb.Text = aList[cycle].getDescription; eventID = aList[cycle].getEventID; rsvp = aList[cycle].getRsvp; eventCategoryLbl.Content = aList[cycle].getGroup; rsvpBtn.Content = ("R.S.V.P +" + rsvp); // Set event box visibiity to true infoBox.Visibility = Visibility.Visible; eventNameLbl.Visibility = Visibility.Visible; timeRemainingLbl.Visibility = Visibility.Visible; eventDescriptionTb.Visibility = Visibility.Visible; eventSubtitleLbl.Visibility = Visibility.Visible; eventCategoryLbl.Visibility = Visibility.Visible; closeBtn.Visibility = Visibility.Visible; rsvpBtn.Visibility = Visibility.Visible; reportBtn.Visibility = Visibility.Visible; //Count down remaining time of event TimeSpan time = new TimeSpan(aList[cycle].getEndTime.Hours, aList[cycle].getEndTime.Minutes, 00); timeRemainingLbl.Content = ((time - DateTime.Now.TimeOfDay).ToString("hh\\:mm") + " Remaining"); FindEvent myFindEvent = new FindEvent("default"); myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); myFindEvent.cycle = cycle++; } }
//Event filter logic private void groupComboBox_DropDownClosed(object sender, EventArgs e) { //get user selection from dropdown list and pass arguement to findevent method switch (groupComboBox.SelectedIndex) { case 0: { FindEvent myFindEvent = new FindEvent("default"); myFindEvent.groupComboBox.SelectedIndex = 0; myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); this.NavigationService.Navigate(myFindEvent); break; } case 1: { FindEvent myFindEvent = new FindEvent("entertainment"); myFindEvent.groupComboBox.SelectedIndex = 1; myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); this.NavigationService.Navigate(myFindEvent); break; } case 2: { FindEvent myFindEvent = new FindEvent("food"); myFindEvent.groupComboBox.SelectedIndex = 2; myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); this.NavigationService.Navigate(myFindEvent); break; } case 3: { FindEvent myFindEvent = new FindEvent("other"); myFindEvent.groupComboBox.SelectedIndex = 3; myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); this.NavigationService.Navigate(myFindEvent); break; } case 4: { FindEvent myFindEvent = new FindEvent("sport"); myFindEvent.groupComboBox.SelectedIndex = 4; myFindEvent.activeUserLabel.Content = activeUserLabel.Content.ToString(); this.NavigationService.Navigate(myFindEvent); break; } } }