private void mnuSetBackground_Click(object sender, RoutedEventArgs e)
        {
            string filename = FileDialog.GetOpenFilename("Open background image...", "png", "Image File");

            if (filename != null)
            {
                try
                {
                    BitmapImage img = new BitmapImage(new Uri(filename));

                    RealizedNetworkImage ri = new RealizedNetworkImage();
                    ri.Bitmap               = img;
                    ri.FullFilename         = filename;
                    ri.SourceImage          = new WirelessNetworkImage();
                    ri.SourceImage.Scale    = 1.0 / 39;
                    ri.SourceImage.Filename = filename;


                    NetworkControl.Images.Clear();
                    NetworkControl.Images.Add(ri);

                    Network.Images.Clear();
                    Network.Images.Add(ri.SourceImage);

                    NetworkControl.Redraw();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Exception while trying to load image.\n" + ex.ToString());
                }
            }
        }
 public void SetNetwork(WirelessNetwork wn)
 {
     Network = wn;
     Images.Clear();
     foreach (var img in Network.Images)
     {
         RealizedNetworkImage ri = new RealizedNetworkImage();
         ri.SourceImage  = img;
         ri.FullFilename = img.Filename;
         ri.Bitmap       = new BitmapImage(new Uri(ri.FullFilename));
         Images.Add(ri);
     }
     InvalidateVisual();
 }