public void AddCollection(ClassificationButton button) //add button
 {
     //_listButton.Add(button);
     //Sort();
     //ButtonList.ItemsSource = _listButton;
     CxClassificationList.AddCollection(button);
 }
Esempio n. 2
0
 public void InvokeSelectionChanged(ClassificationButton btn)  //call in ClassificationButtonList
 {
     if (SelectionChanged != null)
     {
         SelectionChanged.Invoke(this, new CustomEventArgs(btn));
     }
 }
Esempio n. 3
0
        public void AddCollection(ClassificationButton btn)
        {
            //btn.Margin = new Thickness(2); ///////////////////////////////////////////////////////////
            //btn.Index = counter++;
            btn.ColectionParent = this;
            ItemsCollection.Add(btn);

            SetList();
        }
Esempio n. 4
0
        private void CustomListBox_SelectionChanged(object sender, EventArgs e)
        {
            CustomEventArgs customE = e as CustomEventArgs;

            SelectionIndex = customE.SelectedItem.Index;
            SelectionItem  = customE.SelectedItem;

            foreach (ClassificationButton btn in ItemsCollection)
            {
                if (btn != SelectionItem)
                {
                    btn.Highlighted = false;
                    btn.Selected    = false;
                }
            }
        }
Esempio n. 5
0
 public CustomEventArgs(ClassificationButton btn) : base()
 {
     SelectedItem = btn;
     // Index = btn.SortIndex;
 }
 public void AddCollection(ClassificationButton button) //add button
 {
     _listButton.Add(button);
     Sort();
     ButtonList.ItemsSource = _listButton;
 }
        public static void InitCxButtonCollection(ref
                                                  ClassificationButtonCollection cxClassificationButtonCollection)
        {
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Color.FromRgb(236, 58, 88)),
                MarkImage = ClassificationButton.GetIcon("Red"),
                Text      = "Top secret",
                Name      = "Top_secret",
                SortIndex = 0
            });
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Color.FromRgb(252, 120, 84)),
                MarkImage = ClassificationButton.GetIcon("RedOrange"),
                Text      = "Top guarded long headl...",
                Name      = "Top_guarded_long_headl",
                SortIndex = 1
            });
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Color.FromRgb(250, 157, 46)),
                MarkImage = ClassificationButton.GetIcon("Orange"),
                Text      = "Guardeded",
                Name      = "Guardeded",
                SortIndex = 2
            });

            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Color.FromRgb(252, 222, 83)),
                MarkImage = ClassificationButton.GetIcon("Yellow"),
                Text      = "Classified A",
                Name      = "Classified_A",
                SortIndex = 3
            });
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Color.FromRgb(72, 247, 150)),
                MarkImage = ClassificationButton.GetIcon("Green"),
                Text      = "Classified B",
                Name      = "Classified_B",
                SortIndex = 4
            });
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color = new SolidColorBrush(Color
                                            .FromRgb(114, 238, 249)),
                MarkImage = ClassificationButton.GetIcon("Blue"),
                Text      = "General",
                Name      = "General",
                SortIndex = 5
            });
            cxClassificationButtonCollection.AddCollection(
                new ClassificationButton()
            {
                Color     = new SolidColorBrush(Colors.White),
                MarkImage = ClassificationButton.GetIcon("White"),
                Text      = "None",
                Name      = "None",
                SortIndex = 6
            });
            cxClassificationButtonCollection.IsUseMore = true;
            cxClassificationButtonCollection.SortedBy  = true;
        }