Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 IsLoaded Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
FrameworkElement..::.IsLoaded Property

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

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
Visual Basic (Declaration)
Public ReadOnly Property IsLoaded As Boolean
Visual Basic (Usage)
Dim instance As FrameworkElement
Dim value As Boolean

value = instance.IsLoaded
C#
public bool IsLoaded { get; }
Visual C++
public:
property bool IsLoaded {
    bool get ();
}
JScript
public function get IsLoaded () : boolean
XAML
You cannot set this property in XAML.

Property Value

Type: System..::.Boolean
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.

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker