ISupportsFadingTState Interface

Represents a control that supports buffered fading animations based on a custom state type.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public interface ISupportsFading<TState> : IWin32Window
Implements
IWin32Window

Type Parameters

TState
A type that represents the state of the object. It should be meaningfully equatable.

Remarks

A FadingPainterTState instance should be created along with the control. Double buffering should be disabled, otherwise animations will not work. To avoid flickering do not draw anything in the overridden OnPaintBackground method. Override OnPaint, and call FadingPainter<TState>.Paint from there, which uses double buffering internally. That will invoke the PaintState method implementation where the control should be painted with the specified state.

Properties

FadingAnimationDefaultSpeed Gets or sets the default fading animation speed, in milliseconds. 0 means immediate change.
FadingAnimationsEnabled Gets or sets whether fading animations are enabled for the control. Animations work on Windows Vista and above when visual styles are enabled.
IsHandleCreated Gets whether the Handle property is available.
State Gets the current state of the object. When it changes, the control should be invalidated. When the control is repainted but there is no state difference, no animation will be performed.

Methods

GetFadingAnimationSpeed Gets the speed of the animation between two specified states, in milliseconds.
PaintState The implementer method should perform all painting operations here, using the provided state.

See Also