T
the type of element being searched for
Northwoods.GoSilverlight 1.2.2 Assembly
FindElementAt<T> Method
See Also  Send Feedback
Northwoods.GoXam Namespace > DiagramPanel Class : FindElementAt<T> Method

p
a Point in model coordinates
pred
This is a predicate that is given an element of type T; If the predicate returns true, this method returns that element; if it returns false, the search continues for elements at the given point. If this predicate argument is null, no filtering of elements is done -- the first one found is returned.
layers
The kinds of Layers to search in. For example, if you are looking for a Node, using the value SearchLayers.Nodes, this will speed up the search by ignore layers containing Links.
Search all parts that are at a given point that meet a given predicate, and return the first element that matches.

Syntax

Visual Basic (Declaration) 
Public Function FindElementAt(Of T As UIElement)( _
   ByVal p As Point, _
   ByVal navig As Func(Of UIElement,T), _
   ByVal pred As Predicate(Of T), _
   ByVal layers As SearchLayers _
) As T
C# 
public T FindElementAt<T>( 
   Point p,
   Func<UIElement,T> navig,
   Predicate<T> pred,
   SearchLayers layers
)where T: UIElement

Parameters

p
a Point in model coordinates
navig
This is a function that is given an element at the given point and returns an element of type T to be considered by the predicate pred. Typically the function will find the ancestor Part or Node.
pred
This is a predicate that is given an element of type T; If the predicate returns true, this method returns that element; if it returns false, the search continues for elements at the given point. If this predicate argument is null, no filtering of elements is done -- the first one found is returned.
layers
The kinds of Layers to search in. For example, if you are looking for a Node, using the value SearchLayers.Nodes, this will speed up the search by ignore layers containing Links.

Type Parameters

T
the type of element being searched for

Return Value

an element of type T, or null if none is found

Requirements

See Also

© 2010 All Rights Reserved.