XamlType.LookupUsableDuringInitialization Method

Definition

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

C#
protected virtual bool LookupUsableDuringInitialization();

Returns

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

Remarks

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.

Applies to

Product Versions
.NET Framework 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, 10