Element Enumerator Settings

Explanation

The Caliburn.Testability assembly contains an ElementEnumerator capable of traversing all aspects of a WPF UI. This enumerator is used by the BindingValidator to locate elements that require data binding checks. Often times the behavior of this enumerator must be customized. This is the purpose of the ElementEnumeratorSettings class reachable through the Settings property of the BindingValidator.

Note: This feature is only available to WPF due to limitations in the Silverlight API.

Default Settings

Property Default Value
StopAfterFirstError false
IncludeStyles true
IncludeTemplates true
IncludeAllDependencyObjects false
TraverseUserControls false

Explanation of Settings

StopAfterFirstError

Set this property to true if you wish the enumerator to stop traversing the UI after the first error is found.

IncludeStyles

Set this property to false if you wish the enumerator to skip over style properties.

IncludeTemplates

Set this property to false if you wish the enumerator to skip over DataTemplates and ControlTemplates.

IncludeAllDependencyObjects

Set this property to true if you wish every property with a DependencyObject value to have its value traversed. For example, many elements have a Background property of type Brush. Databindings on the brush instance would not normally be checked. If you set this property to true, all properties of the Brush will be checked. Other similar properties that would fall into this category include tooltips and transforms.

TraverseUserControls

Set this property to true if you wish the enumerator to continue traversing all the way through any child UserControls. It is recommended that you leave this property at the default value of false, so that you can test each user control separately.

Last edited Oct 23, 2009 at 7:56 PM by EisenbergEffect, version 4