Skip to main content
.NET Framework Class Library
FrameworkElementIsLoaded Property

Gets a value that indicates whether this element has been loaded for presentation.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
Syntax
Public ReadOnly Property IsLoaded As [%$TOPIC/ms600885_en-us_VS_110_1_0_0_0_0%]
public [%$TOPIC/ms600885_en-us_VS_110_1_0_1_0_0%] IsLoaded { get; }
public:
property [%$TOPIC/ms600885_en-us_VS_110_1_0_2_0_0%] IsLoaded {
	[%$TOPIC/ms600885_en-us_VS_110_1_0_2_0_1%] get ();
}
member IsLoaded : [%$TOPIC/ms600885_en-us_VS_110_1_0_3_0_0%] with get
function get IsLoaded () : [%$TOPIC/ms600885_en-us_VS_110_1_0_4_0_0%]

Property Value

Type: SystemBoolean
true if the current element is attached to an element tree; false if the element has never been attached to a loaded element tree.
Remarks

From a newly constructed FrameworkElement, this property starts off false, and remains true after it is set to true, even if the element is subsequently removed from a connected logical tree by code. true state is set by the general presentation logic when elements are loaded into the presentation engine.

Typically, loaded elements are rendered, but not all FrameworkElement derived classes have a presentation, and other properties such as Visibility can influence presentation.

Examples

The following example implements two handlers: one is handling the Loaded event of the root element, so it is certain that the page root element is loaded because that is the significance of the event. The other handler is hooked to a user control, and calls IsLoaded to assure that the root element is loaded completely. Both handlers call the same function (not shown) that will populate child elements with fresh data.

private void OnLoad(object sender, RoutedEventArgs e)
{
    displayData();
}
private void updateSummary(object sender, RoutedEventArgs e)
{
    if (GroupBoxPage.IsLoaded)
        displayData();
}
Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1