XamlType.LookupUsableDuringInitialization Method ()

.NET Framework (current version)

Returns a value that indicates whether this XamlType is built top-down during XAML initialization.

Namespace:   System.Xaml
Assembly:  System.Xaml (in System.Xaml.dll)

protected virtual bool LookupUsableDuringInitialization()

Return Value

Type: System.Boolean

true if this XamlType is built top-down during XAML initialization; otherwise, false.

Top-down is a metaphor that approximates XAML processor behavior when it creates the object graph. When built top-down, a type is instantiated, attached to the parent, and has its properties set. Top-down construction avoids invoking property-changed handlers multiple times. Such handling ripples up the object graph and therefore, eliminates the multiple handler calls and provides a performance optimization for startup of the object graph.

This method can be invoked by calls to IsUsableDuringInitialization.

The default implementation returns a value based on reading UsableDuringInitializationAttribute. It can also check BaseType for the attribute if no attribute is found on the immediate underlying type. If a value is unavailable, it returns false.

Override this method if you want IsUsableDuringInitialization to use different logic.

.NET Framework
Available since 4.0
Return to top