Xamarin.Forms Guides | Samples

Xamarin.Forms.Behavior<T> Class

Base generic class for generalized user-defined behaviors that can respond to arbitrary conditions and events.

See Also: Behavior<T> Members

Syntax

public abstract class Behavior<T> : Behavior
where T : BindableObject

Type Parameters

T
The type of the objects with which this Behavior`1 can be associated.

Remarks

Application developers should specialize this generic class, instead of directly using Behavior.

Related content

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 0.0.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.Behavior<T> are listed below.

See Also: Behavior

Protected Constructors

Creates a new Behavior`1 instance.

Protected Methods

OnAttachedTo(T)
Application developers override this method to implement the behaviors that will be associated with bindable.
override
OnAttachedTo(BindableObject)
Attaches to the superclass and then calls the Behavior`1.OnAttachedTo(T) method on this object.
OnDetachingFrom(T)
Application developers override this method to remove the behaviors from bindable that were implemented in a previous call to the Behavior`1.OnAttachedTo method.
override
OnDetachingFrom(BindableObject)
Calls the Behavior`1.OnDetachingFrom(T) method and then detaches from the superclass.