Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement.IsLoaded Property

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

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public bool IsLoaded { get; }
/** @property */
public boolean get_IsLoaded ()

public function get IsLoaded () : boolean

You cannot use this property in XAML.

Property Value

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

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.

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();
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft