共用方式為


ExtensionMethods.TraverseVisualTree<T> Method

Definition

Execute a delegate action on all visual descendants of this dependency object of a particular type.

USE SPARINGLY.

This method walks the entire tree. Use of this method on large trees or excessively will introduce a performance hit.

public:
generic <typename T>
 where T : class[System::Runtime::CompilerServices::Extension]
 static void TraverseVisualTree(System::Windows::DependencyObject ^ obj, Action<T> ^ action);
public static void TraverseVisualTree<T> (this System.Windows.DependencyObject obj, Action<T> action) where T : class;
static member TraverseVisualTree : System.Windows.DependencyObject * Action<'T (requires 'T : null)> -> unit (requires 'T : null)
<Extension()>
Public Sub TraverseVisualTree(Of T As Class) (obj As DependencyObject, action As Action(Of T))

Type Parameters

T

Parameters

action
Action<T>

Applies to