Example #1
0
 /// <summary>
 ///
 /// </summary>
 public void LoadCourses()
 {
     foreach (Course course in _contentManager.GetAllCourses())
     {
         Image image = new Image()
         {
             Source     = new BitmapImage(new Uri(course.Icon)),
             RenderSize = new Size(100, 100),
             MaxHeight  = 100,
             MaxWidth   = 100,
             Margin     = new Thickness(10),
             Opacity    = 0.5,
             Name       = "Image_" + course.ID
         };
         image.MouseUp += delegate(object senderImage, MouseButtonEventArgs eventArgs)
         {
             ImageCourse_Click(senderImage as Image);
         };
         if (!_courseImagesCache.ContainsKey(image.Name))
         {
             _courseImagesCache[image.Name] = course.ID;
             Courses.Children.Add(image);
         }
     }
 }