Public Member Functions | Public Attributes | Properties | List of all members
WpfInteractor Class Reference

Implementation of an IInteractor for WPF. More...

Inheritance diagram for WpfInteractor:
Interactor InteractorBase IMutableBehaviorsInteractor EventHandlingBase IInteractor IInteractor IChecksummable IChecksummable

Public Member Functions

 WpfInteractor (FrameworkElement element, IWpfInteractorAgent agent, string id=null)
 Initializes a new instance of the WpfInteractor class. More...
 
override Rectangle GetBounds ()
 Gets the bounds of the interactor. More...
 
void SetIsEnabled (bool isEnabled)
 Sets the IsEnabled flag of the interactor. More...
 
Task InvokeOnElementAsync (Action action)
 Invoke and action on the UI thread of the FrameworkElement associated with this interactor. More...
 
WpfInteractor EnableEventEffects ()
 Enables all event effects. More...
 
WpfInteractor DisableEventEffects ()
 Disables all event effects. More...
 
- Public Member Functions inherited from Interactor
override bool TryGetBehavior (Framework.BehaviorType behaviorType, out IBehavior behavior)
 Tries to resolve a behavior associated with this interactor using the behavior's type. More...
 
virtual void AddBehavior (IBehavior behavior)
 Adds a behavior to the interactor. More...
 
virtual void RemoveBehavior (Framework.BehaviorType behaviorType)
 Removes the behavior that is associated with the provided Framework.BehaviorType. More...
 

Public Attributes

bool IsUnavailable => !_isBoundToElement || !_elementIsVisible
 Gets whether the interactor is available. For example when the interactor is alive and well, but residing in a UI element that is not currently visible. More...
 

Properties

FrameworkElement Element [get]
 Gets the framework element. More...
 
FrameworkElement TopLevelElement [get]
 Gets the top level element. More...
 
Rectangle CachedBounds [get]
 Gets the cached bounds. More...
 
- Properties inherited from Interactor
override IEnumerable< IBehaviorBehaviors [get]
 Gets the behaviors associated with this interactor. More...
 
- Properties inherited from InteractorBase
string Id [get]
 Gets the interactor identifier. More...
 
string ParentId [get]
 Gets the interactor's parent identifier. More...
 
string WindowId [get]
 Gets the window identifier that this interactor belong to. More...
 
double Z [get]
 Gets the Z order of the interactor. More...
 
bool IsDeleted [get]
 Gets the IsDeleted flag of the interactor. More...
 
bool IsEnabled [get]
 Gets/sets the IsEnabled flag of the interactor. More...
 
abstract IEnumerable< IBehaviorBehaviors [get]
 Gets the behaviors associated with this interactor. More...
 
IMask Mask [get]
 Gets the IMask used to describe the geometry of the interactor in detail (if needed). Will be null when the interactor has no mask (the normal case). More...
 
RectangleMaskBounds [get]
 Gets a rectangle describing the mask bounds. The mask bounds describe the geometry over which the mask applies. The X and Y coordinates are relative to the X and Y coordinates of the interactor bounds. If no bounds are supplied the same bounds as for the interactor will be assumed. More...
 
- Properties inherited from IInteractor
string Id [get]
 Gets the interactor identifier. More...
 
string ParentId [get]
 Gets the interactor's parent identifier. More...
 
string WindowId [get]
 Gets the window identifier that this interactor belong to. More...
 
double Z [get]
 Gets the Z order of the interactor. More...
 
bool IsDeleted [get]
 Gets the IsDeleted flag of the interactor. More...
 
bool IsEnabled [get]
 Gets the IsEnabled flag of the interactor. More...
 
IEnumerable< IBehaviorBehaviors [get]
 Gets the behaviors associated with this interactor. More...
 
IMask Mask [get]
 Gets the IMask used to describe the geometry of the interactor in detail (if needed). Will be null when the interactor has no mask (the normal case). More...
 
RectangleMaskBounds [get]
 Gets a rectangle describing the mask bounds. The mask bounds describe the geometry over which the mask applies. The X and Y coordinates are relative to the X and Y coordinates of the interactor bounds. If null, the same bounds as for the interactor will be assumed. More...
 

Detailed Description

Implementation of an IInteractor for WPF.

Constructor & Destructor Documentation

◆ WpfInteractor()

WpfInteractor ( FrameworkElement  element,
IWpfInteractorAgent  agent,
string  id = null 
)
inline

Initializes a new instance of the WpfInteractor class.

Parameters
elementThe element.
idThe identifier.

Member Function Documentation

◆ GetBounds()

override Rectangle GetBounds ( )
inlinevirtual

Gets the bounds of the interactor.

Returns
The bounds of the interactor.

Implements InteractorBase.

◆ SetIsEnabled()

void SetIsEnabled ( bool  isEnabled)
inline

Sets the IsEnabled flag of the interactor.

The IsEnabled flag value for the interactor.

◆ InvokeOnElementAsync()

Task InvokeOnElementAsync ( Action  action)
inline

Invoke and action on the UI thread of the FrameworkElement associated with this interactor.

Parameters
actionThe action to be invoked.
Returns
A Task representing the invocation.

◆ EnableEventEffects()

WpfInteractor EnableEventEffects ( )
inline

Enables all event effects.

Returns
The WpfInteractor.

◆ DisableEventEffects()

WpfInteractor DisableEventEffects ( )
inline

Disables all event effects.

Returns
The WpfInteractor.

Member Data Documentation

◆ IsUnavailable

bool IsUnavailable => !_isBoundToElement || !_elementIsVisible

Gets whether the interactor is available. For example when the interactor is alive and well, but residing in a UI element that is not currently visible.

Marks if the interactor is unavailable, e.g. if the element which it is bound to has been unloaded. This state is not the same as deleted, but if it is unavailable then a snapshot interactor which gets populated with this interactor is marked as deleted. This is so hidden elements can remove its interactor immediately, and not wait for the cache to timeout.

Property Documentation

◆ Element

FrameworkElement Element
get

Gets the framework element.

The element.

◆ TopLevelElement

FrameworkElement TopLevelElement
get

Gets the top level element.

The window.

◆ CachedBounds

Rectangle CachedBounds
get

Gets the cached bounds.

The cached bounds.


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