private void bucket_edit_Click(object sender, RoutedEventArgs e) //used when clicked on the button to edit the explored tab { countryVisited selectedVisited = list_bx_world_visited.SelectedItem as countryVisited; var dateAndTime = DateTime.Now; //Getting the date and time if (selectedVisited != null) { if (selectedVisited.countryNotes == "Custom notes on countries you wish visit will be shown here") { selectedVisited.countryNotes = null; string input = Interaction.InputBox("Enter notes about your visit to this country?", "Notes", "", -1, -1); string note = "Notes: " + input + "\nDated: " + dateAndTime + "\nTime Visited: " + visitedCounter + "\n\n"; selectedVisited.countryNotes = note; } else { selectedVisited.visitedCounter = selectedVisited.visitedCounter + 1; string input = Interaction.InputBox("Enter notes about your visit to this country?", "Notes", "", -1, -1); string appendednote = "Entry: #" + selectedVisited.visitedCounter + "\nNotes: " + input + "\nDated: " + dateAndTime + "\nTime Visited: " + visitedCounter + "\n\n"; selectedVisited.countryNotes = selectedVisited.countryNotes + appendednote; } } else { MessageBox.Show("Please add a country you've visited to add notes!", "Attention!"); } }
private void list_bx_world_visited_SelectionChanged(object sender, SelectionChangedEventArgs e) //displays the notes for each country visited when selected in the list { countryVisited selectedVisited = list_bx_world_visited.SelectedItem as countryVisited; if (selectedVisited != null) { txtBlk_notes.Text = selectedVisited.countryNotes; } else { MessageBox.Show("Please add a country you've visited to add notes!", "Attention!"); } }
private void bucket_add_Click(object sender, RoutedEventArgs e) //Add countries to the bucket list from text box input { string countryName = country_visited_input.Text; if (string.IsNullOrEmpty(country_visited_input.Text)) { MessageBox.Show("Please enter a country to add to bucketlist!", "Attention!"); } else { visitedCounter = +1; countryVisited visted = new countryVisited(countryName, "Custom notes on countries you wish visit will be shown here", 0); list_bx_world_bucket.Items.Add(visted); country_visited_input.Clear(); country_visited_input.Focus(); } }