private void InitSiteList() { SiteList.Children.Clear(); sconnSite[] sites = sconnDataShare.getSites(); _sitesPanel = new SitePanel(SiteList.Width, SiteList.Height); foreach (sconnSite site in sites) { SitePanelItem item = new SitePanelItem(site.siteName, SiteList.Width, SiteList.Height * 0.1, site.siteID); item.SiteBtn1.Click += new RoutedEventHandler((sender, e) => ViewSiteClick(sender, e, item.SiteName)); item.SiteBtn2.Click += new RoutedEventHandler((sender, e) => ConfigSiteClick(sender, e, item.SiteName)); item.SiteBtn3.Click += new RoutedEventHandler((sender, e) => EditSiteClick(sender, e, item.SiteName)); //siteList.Children.Add(item); _sitesPanel.AddStatusItem(item); } _sitesPanel.SelectItemChanged += sitesPanel_SelectItemChanged; SiteList.Children.Add(_sitesPanel); //ImageBrush img1 = new ImageBrush(); //ImageBrush img2 = new ImageBrush(); //ImageBrush img3 = new ImageBrush(); //img1.ImageSource = new BitmapImage(new Uri("pack://application:,,,/images/cog3.jpg", UriKind.Absolute)); //btnSites.Background = img1; //img2.ImageSource = new BitmapImage(new Uri("pack://application:,,,/images/key1.jpg", UriKind.Absolute)); //btnConfig.Background = img2; //img3.ImageSource = new BitmapImage(new Uri("pack://application:,,,/images/stat1.jpg", UriKind.Absolute)); //btnMap.Background = img3; }
private void InitSiteList() { SiteListPanel.Children.Clear(); sconnSite[] sites = sconnDataShare.getSites(); _sitesPanel = new SitePanel(SiteListPanel.Width, SiteListPanel.Height); foreach (sconnSite site in sites) { SitePanelItem item = new SitePanelItem(site.siteName, SiteListPanel.Width, SiteListPanel.Height * 0.2, site.siteID); _sitesPanel.AddStatusItem(item); } _sitesPanel.SelectItemChanged += sitesPanel_SelectItemChanged; SiteListPanel.Children.Add(_sitesPanel); }