#615 – Standard Object Lifetime Events for FrameworkElement Objects

All objects in WPF that derive from FrameworkElement or FrameworkContentElement have three common events that fire as part of the element’s lifecycle.  Because these events are inherited from FrameworkElement and FrameworkContentElement, they are available for all controls, layout panels, Window objects and Page objects.

The three main object lifetime events are:

  • Initialized – Fires when an object has been created and all of its properties have been set.  Properties relating to layout have not yet been set
  • Loaded – Fires after the layout system has calculated all properties related to layout.  Data binding has occurred at this point, so controls should have their final property values.
  • Unloaded – Fires when element is removed from logical tree.  Will not fire if application is shutting down.
Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #615 – Standard Object Lifetime Events for FrameworkElement Objects

  1. Pingback: #616 – FrameworkElement.Initialized and Loaded Event Order « 2,000 Things You Should Know About WPF

  2. Pingback: Dew Drop – August 2, 2012 (#1,376) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: