FrameworkContentElement.IsLoaded Property

Definition

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

C#
public bool IsLoaded { get; }

Property Value

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

Examples

The following example code uses IsLoaded as a conditional check to assure that a function displayData (not shown) will have valid elements loaded on the page to work against, as part of an on-demand handler. That same logic is run as an event handler for Loaded.

C#
private void OnLoad(object sender, RoutedEventArgs e)
{
    displayData();
}
private void updateSummary(object sender, RoutedEventArgs e)
{
    if (myflowdocument.IsLoaded)
        displayData();
}

Remarks

From a newly constructed instance, this property starts off false, and remains true once it is set to true, even if subsequently removed by code.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also