Static Public Member Functions | Static Public Attributes | List of all members
FrameworkElementExtensions Class Reference

Contains extension methods for FrameworkElement. More...

Static Public Member Functions

static void SetInteractor (this FrameworkElement element, WpfInteractor interactor)
 Attaches an interactor to this FrameworkElement. More...
 
static WpfInteractor GetInteractor (this FrameworkElement self)
 Gets the interactor for this FrameworkElement. More...
 
static FrameworkElement GetParent (this FrameworkElement self)
 Gets the parent for this FrameworkElement More...
 
static IEnumerable< FrameworkElement > GetAncestors (this FrameworkElement self, bool includeSelf=false)
 Gets all ancestors for this FrameworkElement. More...
 
static FrameworkElement FindAncestor (this FrameworkElement self, Func< FrameworkElement, bool > condition)
 Find the first ancestor for this FrameworkElement which meets the supplied condition. More...
 
static TElement FindAncestor< TElement > (this FrameworkElement self)
 Find the first ancestor to this FrameworkElement of type TElement. More...
 
static FrameworkElement GetTopLevelElement (this FrameworkElement self)
 Gets the top level framework element for this FrameworkElement. More...
 
static Window GetTopLevelWindow (this FrameworkElement self)
 Gets the top level window for this FrameworkElement. More...
 
static IntPtr GetWindowHandle (this FrameworkElement element)
 Gets the window handle for this FrameworkElement. More...
 

Static Public Attributes

static readonly DependencyProperty InteractorProperty
 The interactor dependency property. More...
 

Detailed Description

Contains extension methods for FrameworkElement.

Member Function Documentation

◆ SetInteractor()

static void SetInteractor ( this FrameworkElement  element,
WpfInteractor  interactor 
)
inlinestatic

Attaches an interactor to this FrameworkElement.

Parameters
elementThe framework element.
interactorThe interactor.

◆ GetInteractor()

static WpfInteractor GetInteractor ( this FrameworkElement  self)
inlinestatic

Gets the interactor for this FrameworkElement.

Parameters
selfThe framework element to get the interactor for.
Returns
An interactor, or null if not found.

◆ GetParent()

static FrameworkElement GetParent ( this FrameworkElement  self)
inlinestatic

Gets the parent for this FrameworkElement

Parameters
selfThe framework element.
Returns
The parent framework element.

◆ GetAncestors()

static IEnumerable<FrameworkElement> GetAncestors ( this FrameworkElement  self,
bool  includeSelf = false 
)
inlinestatic

Gets all ancestors for this FrameworkElement.

Parameters
selfThe framework element.
includeSelfWhether to include this framework element as an ancestor.
Returns
The found ancestor framework elements.

◆ FindAncestor()

static FrameworkElement FindAncestor ( this FrameworkElement  self,
Func< FrameworkElement, bool >  condition 
)
inlinestatic

Find the first ancestor for this FrameworkElement which meets the supplied condition.

Parameters
selfThe framework element.
conditionThe condition for finding ancestors.
Returns
The found ancestor.

◆ FindAncestor< TElement >()

static TElement FindAncestor< TElement > ( this FrameworkElement  self)
inlinestatic

Find the first ancestor to this FrameworkElement of type TElement.

Template Parameters
TElementThe type of the sought ancestor.
Parameters
selfThe framework element.
Returns
The found ancestor.
Type Constraints
TElement :FrameworkElement 

◆ GetTopLevelElement()

static FrameworkElement GetTopLevelElement ( this FrameworkElement  self)
inlinestatic

Gets the top level framework element for this FrameworkElement.

Parameters
selfThe framework element.
Returns
The top level framework element.

◆ GetTopLevelWindow()

static Window GetTopLevelWindow ( this FrameworkElement  self)
inlinestatic

Gets the top level window for this FrameworkElement.

Parameters
selfThe framework element.
Returns
The top level window.

◆ GetWindowHandle()

static IntPtr GetWindowHandle ( this FrameworkElement  element)
inlinestatic

Gets the window handle for this FrameworkElement.

Parameters
elementThe framework element.
Returns
The window handle.

Member Data Documentation

◆ InteractorProperty

readonly DependencyProperty InteractorProperty
static
Initial value:
= DependencyProperty.RegisterAttached(
"Interactor", typeof(WpfInteractor),
typeof(WpfInteractor),
new PropertyMetadata(default(WpfInteractor)))

The interactor dependency property.


The documentation for this class was generated from the following file: