예제 #1
0
        private void OnHighlightSelectedCategories()
        {
            if (this.comp_manager == null)
            {
                return;
            }

            List <string>   selected_categories = new List <string>(this.existing_categories.Where(x => x.IsSelected == true).Select(x => x.ObjectData));
            List <Category> sc = new List <Category>();

            foreach (string cat in selected_categories)
            {
                sc.Add(ComponentUtils.StringToCategory(cat));
            }

            this.canv.Highlight(sc, this.category_or);
        }
        private void PopulateStackPanel_Categories()
        {
            // category toggles
            int nr_categories = Enum.GetNames(typeof(Category)).Count();

            for (int i = 0; i < nr_categories - 2; i++)
            {
                ToggleButton tbtn = new ToggleButton();
                tbtn.Style             = (Style)tbtn.TryFindResource("ToggleButtonBWRound");
                tbtn.Content           = ComponentUtils.CATEGORY_NONE_AS_STR[i].ToString().ToUpper();
                tbtn.FontFamily        = new FontFamily(new Uri("pack://application:,,,/ComponentBuilder;component/Data/fonts/"), "./#categories");
                tbtn.FontSize          = 18;
                tbtn.Margin            = new Thickness(0, 0, 2, 0);
                tbtn.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                tbtn.ToolTip           = ComponentUtils.CategoryStringToDescription(tbtn.Content.ToString());
                tbtn.Tag    = ComponentUtils.StringToCategory(tbtn.Content.ToString());
                tbtn.Cursor = Cursors.Hand;
                tbtn.Click += category_CLick;

                this.Children.Add(tbtn);
            }
        }