private void DisplayEventPreviews()
 {
     previewList.Children.Clear();
     foreach (Event e in FilteredDbList(this.filter))
     {
         e.Category = db.Categories.FirstOrDefault(c => c.Id == e.CategoryId);
         var child = EventPreviewMaker.CreatePreview(e);
         child.MouseDown += SelectEvent;
         previewList.Children.Add(child);
     }
 }
 private void DisplayEventDetails()
 {
     if (selectedEvent != null)
     {
         eventTitle.Text               = selectedEvent.Title;
         eventBody.Text                = selectedEvent.Body;
         eventNote.Text                = selectedEvent.Note;
         eventCategory.Text            = db.Categories.FirstOrDefault(x => x.Id == selectedEvent.CategoryId).Name;
         eventDate.Text                = selectedEvent.Date.ToShortDateString();
         eventDetailsBorder.Background = EventPreviewMaker.GetColoredBackground(selectedEvent.CategoryId);
     }
 }