I’d like to know more about the lifecycle of winforms. I know that the BindingContextChanged event sets the Visible property of the form to true. But I was wondering, which context is bind to the form? What triggers the BindingContextChanged so the forms property Visible is set to true?
I’d like to know more about the lifecycle of winforms. I know that the
Share
I wasn’t aware of a tight correlation between
BindingContextandVisible, but generally each form simply gets a newBindingContext. If you need to do something funky with separate binding-contexts between different controls, then you have that option by assigning your ownBindingContextto some controls.Looking in reflector, it looks like the
BindingContextis set for the first time diring thegetinContainerControl– in fact, that is the only place in the BCL where it appears to benewed:i.e. it is lazily instantiated when a
BindingContextis first needed, and assigning tothis.BindingContextcauses the event (etc) to be invoked.Not sure why you think this ties into
Visible– care to explain?