We're hooking up events to InitializeWeek. We're also subclassing UltraMonthViewSingle so that we can assign our default values to properties in the constructor of the derived class.
We've noticed that the three Initialize events (Day, Week, Month) will fire off as soon as we set some of the control's properties. These are the properties we've identified as causing the immediate firing:
CalendarInfo.FirstDayOfWeek CalendarInfo.MaxSelectedDays CalendarInfo.SelectTypeActivity WeekHeaderDisplayStyle
Our assumption is that the control shouldn't behave this way as we're not aware of UltraGrid or other controls in the library firing Initialize events this early.
Should we be using the control differently, or is our assumption correct?
Thanks
I don't know the details of what you are trying to accomplish, but it would seem you could set a flag when you have hooked all the events you wnt to listen to, and bypass whatever code you have in InitializeDay/InitializeWeek/InitializeMonth, etc. when that flag is false.
Thanks.
I see your point, but I'm still hoping for a way to configure the control to postpone its initializations until we've had the chance to hook up all of our event handlers.
All the Initialize events fire when something triggers the creation of the corresponding object; for example, if something causes a Week object to be created, the InitializeWeek event is fired. When you access an UltraCalendarInfo property, the get method might need to create the object in order to return the correct value, hence the firing of the event.