Commits

alexdavies74  committed 9e01f8b

Factor out interesting bit from boring bit

  • Participants
  • Parent commits 08f5e70

Comments (0)

Files changed (1)

File FaviconBrowser/MainWindow.xaml.cs

         {
             WebClient webClient = new WebClient();
             byte[] bytes = webClient.DownloadData("http://" + domain + "/favicon.ico");
+            Image imageControl = MakeImageControl(bytes);
+            m_WrapPanel.Children.Add(imageControl);
+        }
+
+        private static Image MakeImageControl(byte[] bytes)
+        {
             Image imageControl = new Image();
             BitmapImage bitmapImage = new BitmapImage();
             bitmapImage.BeginInit();
             imageControl.Source = bitmapImage;
             imageControl.Width = 16;
             imageControl.Height = 16;
-            m_WrapPanel.Children.Add(imageControl);
+            return imageControl;
         }
     }
 }