/// <summary> /// Builds the control dictionaries this class uses /// </summary> private void BuildDictionaries() { buttons = new Dictionary <DayOfWeek, Button>(); controllers = new Dictionary <DayOfWeek, DarkButton>(); buttonValues = new Dictionary <DayOfWeek, bool>(); foreach (DayOfWeek day in Enum.GetValues(typeof(DayOfWeek))) { buttonValues.Add(day, false); Button dayButton = null; switch (day) { case DayOfWeek.Sunday: dayButton = mainControl.Sunday; break; case DayOfWeek.Monday: dayButton = mainControl.Monday; break; case DayOfWeek.Tuesday: dayButton = mainControl.Tuesday; break; case DayOfWeek.Wednesday: dayButton = mainControl.Wednesday; break; case DayOfWeek.Thursday: dayButton = mainControl.Thursday; break; case DayOfWeek.Friday: dayButton = mainControl.Friday; break; case DayOfWeek.Saturday: dayButton = mainControl.Saturday; break; default: throw new Exception("Invalid Day Of Week"); } buttons.Add(day, dayButton); DarkButton button = new DarkButton(dayButton); button.SetIdleColors(Colors.DarkGray, Colors.Black); button.SetActiveColors(Colors.Black, Colors.DarkGray); controllers.Add(day, button); } }
/// <summary> /// Assigns the button controlers that execute the dark theme /// </summary> private void AssignButtonControllers() { //iterate over the time UI elements foreach (UIElement button in new List <UIElement>() { hostWindow.GetAMPMButton(), hostWindow.GetHourUpButton(), hostWindow.GetHourDownButton(), hostWindow.GetMinuteDownButton(), hostWindow.GetMinuteUpButton() }) { DarkButton tempButton = new DarkButton(button); tempButton.SetIdleColors(Color.FromArgb(0xFF, 0x24, 0x24, 0x24), Colors.White); tempButton.SetActiveColors(Colors.Black, Colors.White); } }