Class VisualStateBehavior
Inherited Members
Namespace: Syncfusion.Windows.Controls
Assembly: Syncfusion.Shared.Wpf.dll
Syntax
public abstract class VisualStateBehavior
Constructors
VisualStateBehavior()
Declaration
protected VisualStateBehavior()
Fields
VisualStateBehaviorProperty
The attached DependencyProperty for VisualStateBehavior.
Declaration
public static readonly DependencyProperty VisualStateBehaviorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Properties
TargetType
Specifies the Type of the Control that this behavior targets.
Declaration
protected abstract Type TargetType { get; }
Property Value
Type |
---|
System.Type |
Methods
AddValueChanged(DependencyProperty, Type, Object, EventHandler)
Attaches an event handler to be called when a property changes.
Declaration
protected static bool AddValueChanged(DependencyProperty dp, Type targetType, object instance, EventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyProperty | dp | When this DependencyProperty changes on the instance, the handler will be called. |
System.Type | targetType | The target type of the property or the instance if it is an attached property. |
System.Object | instance | The instance of the object. |
System.EventHandler | handler | The handler to call. |
Returns
Type | Description |
---|---|
System.Boolean | true if the handler was attached, false otherwise. |
GetVisualStateBehavior(DependencyObject)
Returns the value of the VisualStateBehavior attached property.
Declaration
public static VisualStateBehavior GetVisualStateBehavior(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj |
Returns
Type |
---|
VisualStateBehavior |
OnAttach(Control)
Attach to the appropriate events on the instance of the control in order to update the state correctly.
Declaration
protected abstract void OnAttach(Control control)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.Control | control | An instance of the control. |
OnDetach(Control)
Detach to the appropriate events on the instance of the control in order to not leak memory.
Declaration
protected abstract void OnDetach(Control control)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.Control | control | An instance of the control. |
RegisterBehavior(VisualStateBehavior)
Applies the specified behavior to all instances of the target control type.
Declaration
public static void RegisterBehavior(VisualStateBehavior behavior)
Parameters
Type | Name | Description |
---|---|---|
VisualStateBehavior | behavior | The behavior being registered. |
RemoveValueChanged(DependencyProperty, Type, Object, EventHandler)
Declaration
protected static bool RemoveValueChanged(DependencyProperty dp, Type targetType, object instance, EventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyProperty | dp | |
System.Type | targetType | |
System.Object | instance | |
System.EventHandler | handler |
Returns
Type |
---|
System.Boolean |
SetVisualStateBehavior(DependencyObject, VisualStateBehavior)
Sets the value of the VisualStateBehavior attached property. Setting the value will attach the behavior to the instance of the control.
Declaration
public static void SetVisualStateBehavior(DependencyObject obj, VisualStateBehavior value)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyObject | obj | |
VisualStateBehavior | value |
UpdateState(Control, Boolean)
Called to update the control's visual state.
Declaration
protected abstract void UpdateState(Control control, bool useTransitions)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Controls.Control | control | The instance of the control being updated. |
System.Boolean | useTransitions | Whether to use transitions or not. |
UpdateStateHandler(Object, EventArgs)
Declaration
protected abstract void UpdateStateHandler(object o, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | |
System.EventArgs | e |