Example #1
0
 public void OnButtonClick(ModuleButton clickedButton)
 {
     clickedButton.Highlight();
     foreach (var button in buttons)
     {
         if (button != clickedButton)
         {
             button.Darken();
         }
     }
 }
Example #2
0
        public void AddModuleButton(string name, Action click = null)
        {
            var button = new ModuleButton(name, StackPanel.Children.Count == 0);

            buttons.Add(button);
            button.Click += (sender, args) => OnButtonClick(button);
            if (click != null)
            {
                button.Click += (sender, args) => click();
            }

            StackPanel.Children.Add(button);
        }