Skip to main content
.NET Framework Class Library
FrameworkElementInitialized Event

Occurs when this FrameworkElement is initialized. This event coincides with cases where the value of the IsInitialized property changes from false (or undefined) to true.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax
Public Event Initialized As [%$TOPIC/ms596557_en-us_VS_110_3_0_0_0_0%]
public event [%$TOPIC/ms596557_en-us_VS_110_3_0_1_0_0%] Initialized
public:
 event [%$TOPIC/ms596557_en-us_VS_110_3_0_2_0_0%]^ Initialized {
	void add ([%$TOPIC/ms596557_en-us_VS_110_3_0_2_0_1%]^ value);
	void remove ([%$TOPIC/ms596557_en-us_VS_110_3_0_2_0_2%]^ value);
}
member Initialized : IEvent<[%$TOPIC/ms596557_en-us_VS_110_3_0_3_0_0%],
    [%$TOPIC/ms596557_en-us_VS_110_3_0_3_0_1%]>
<object Initialized="[%$TOPIC/ms596557_en-us_VS_110_3_0_4_0_0%]" .../>
Remarks

This event will be raised whenever the EndInit or OnVisualParentChanged methods are called. Calls to either method could have come from application code, or through the Extensible Application Markup Language (XAML) processor behavior when a XAML page is processed.

Whether you choose to handle Loaded or Initialized depends on your requirements. If you do not need to read element properties, intend to reset properties, and do not need any layout information, Initialized might be the better event to act upon. If you need all properties of the element to be available, and you will be setting properties that are likely to reset the layout, Loaded might be the better event to act upon. Be careful of reentrancy if your handler resets any properties that are interpreted by the layout system to mean that a new layout pass is required. (You might need to check the FrameworkPropertyMetadata values on the property if you are unsure of which properties can require a new layout pass if they are changed.)

For more information about the sequence of object events for a FrameworkElement, and also for several related application and element classes, see Object Lifetime Events.

Version Information

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.