XAML and ISupportInitialize
In the .Net Framework 3.0 and later, when objects are created by loading XAML, we check to see if they implement ISupportInitialize and call BeginInit and EndInit on the instance before we set properties and after we are done setting properties.
Why would an object want to support ISupportInitialize?
- Perhaps they want to get all their properties set before they validate them. The EndInit call is a signal to do that validation.
Mike Hillberg describes a bit of the XAML and much more of the WPF side of things in Loaded Vs Initialized.
Misc Notes
- WPF 3.* has a problem with firing BeginInit/EndInit twice on UserControls. A forum post (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1907827&SiteID=1&mode=1) brought to our attention the fact that we fire ISupportInitialize.BeginInit and .EndInit too often in WPF 3.*. I detail a workaround (that you'll only want to use if you implement ISupportInitialize in your UserControl) in the forum post that should work fine, even after we fix this issue someday...
- The only other interface that comes to mind that we will call on objects that are created is IUriContext.