Example #1
0
 private void lstBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (lstBox.DataContext != null)
     {
         try
         {
             var     item            = (ListBox)sender;
             Student selectedStudent = student.SelectedItem((Student)item.SelectedItem);
             if (selectedStudent != null)
             {
                 this.selectedItem    = selectedStudent.ID;
                 nameLbl.Content      = selectedStudent.Name;
                 emailLbl.Content     = selectedStudent.Email;
                 phoneLbl.Content     = selectedStudent.PhoneNo;
                 officeLbl.Content    = selectedStudent.OfficeNo;
                 courseLbl.Content    = selectedStudent.CourseTitle;
                 courseFeeLbl.Content = selectedStudent.CourseFee;
             }
         }
         catch
         {
         }
     }
 }