private void ActiveButton_OnClick(object sender, RoutedEventArgs e) { ShiftActive = !ShiftActive; if (_shift != null) // if is a shift, then canceling { _shift.CancelShift(_date); } else if (_time != null) { foreach (var shift in ShiftHandler.CoatingInstance.Shifts.Where(shift => shift.ExceptionList.Contains(_time))) { shift.ExceptionList.Remove(_time); } } ParentControl.Refresh(); }