Upravit

Sdílet prostřednictvím


XamlType.LookupUsableDuringInitialization Method

Definition

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

protected:
 virtual bool LookupUsableDuringInitialization();
protected virtual bool LookupUsableDuringInitialization ();
abstract member LookupUsableDuringInitialization : unit -> bool
override this.LookupUsableDuringInitialization : unit -> bool
Protected Overridable Function LookupUsableDuringInitialization () As Boolean

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