Class AnimationView
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
The AnimationView is designed to show and play animation of vector graphics based content. Currently ElmSharp AnimationView is supporting only json format (known for Lottie file as well).
public class AnimationView : EvasObject
- Inheritance
Constructors
View SourceAnimationView(EvasObject)
Creates and initializes a new instance of the AnimationView class.
Declaration
public AnimationView(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | The parent is a given container, which will be attached by AnimationView as a child. It's EvasObject type. |
Properties
View SourceAutoPlay
Sets or gets whether to play animation automatically.
Declaration
public bool AutoPlay { get; set; }
Property Value
Type | Description |
---|---|
bool |
AutoRepeat
Sets or gets whether to turn on/off animation looping.
Declaration
public bool AutoRepeat { get; set; }
Property Value
Type | Description |
---|---|
bool |
DefaultSize
Get the default view size that specified from vector resource.
Declaration
public Size DefaultSize { get; }
Property Value
Type | Description |
---|---|
Size |
DurationTime
Get the duration of animation in seconds.
Declaration
public double DurationTime { get; }
Property Value
Type | Description |
---|---|
double |
Remarks
Returns total duration time of current animation in the seconds. If current animation source isn't animatable, it returns zero.
Frame
Sets or gets current frame position of animation view.
Declaration
public int Frame { get; set; }
Property Value
Type | Description |
---|---|
int |
FrameCount
Get the index of end frame of the AnimationView, if it's animated.
Declaration
public int FrameCount { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Frame number starts with 0.
IsReversedPlaying
Get the status whether current animation is on playing forward or backward.
Declaration
public bool IsReversedPlaying { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
If AnimationView is not on playing, it will return False.
MaxFrame
Sets or Gets the last frame of the play
Declaration
public int MaxFrame { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Default value is FrameCount -1.
MaxProgress
Sets or Gets the last progress of the play
Declaration
public double MaxProgress { get; set; }
Property Value
Type | Description |
---|---|
double |
Remarks
Default value is 1.
MinFrame
Sets or Gets the start frame of the play
Declaration
public int MinFrame { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Default value is 0.
MinProgress
Sets or Gets the start progress of the play
Declaration
public double MinProgress { get; set; }
Property Value
Type | Description |
---|---|
double |
Remarks
Default value is 0.
Progress
Sets or gets current progress position of animation view.
Declaration
public double Progress { get; set; }
Property Value
Type | Description |
---|---|
double |
Speed
Sets or gets the animation speed.
Declaration
public double Speed { get; set; }
Property Value
Type | Description |
---|---|
double |
State
Get current animation view state.
Declaration
public AnimationViewState State { get; }
Property Value
Type | Description |
---|---|
AnimationViewState |
Methods
View SourceCreateHandle(EvasObject)
Creates a AnimationView handle.
Declaration
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type | Name | Description |
---|---|---|
EvasObject | parent | Parent EvasObject. |
Returns
Type | Description |
---|---|
System.IntPtr | Handle IntPtr. |
Overrides
View SourcePause()
Pause current animation instantly.
Declaration
public void Pause()
Play()
Play animation one time instantly when it's available.
Declaration
public void Play()
Play(bool)
Play animation one time instantly when it's available.
Declaration
public void Play(bool isReverse)
Parameters
Type | Name | Description |
---|---|---|
bool | isReverse | Whether the animation play or reverse play. |
Resume()
Resume paused animation to continue animation.
Declaration
public void Resume()
Remarks
This resume must be called on animation paused status.
SetAnimation(string)
Sets the animation source file.
Declaration
public void SetAnimation(string file)
Parameters
Type | Name | Description |
---|---|---|
string | file | The animation file path. |
Stop()
Stop playing animation.
Declaration
public void Stop()
Events
View SourceFinished
It occurs when the animation is just finished.
Declaration
public event EventHandler Finished
Event Type
Type | Description |
---|---|
System.EventHandler |
Paused
It occurs when the animation is just paused.
Declaration
public event EventHandler Paused
Event Type
Type | Description |
---|---|
System.EventHandler |
Repeated
It occurs when the animation is just repeated.
Declaration
public event EventHandler Repeated
Event Type
Type | Description |
---|---|
System.EventHandler |
Resumed
It occurs when the animation is just resumed.
Declaration
public event EventHandler Resumed
Event Type
Type | Description |
---|---|
System.EventHandler |
Started
It occurs when the animation is just started.
Declaration
public event EventHandler Started
Event Type
Type | Description |
---|---|
System.EventHandler |
Stopped
It occurs when the animation is just stopped.
Declaration
public event EventHandler Stopped
Event Type
Type | Description |
---|---|
System.EventHandler |
Updated
It occurs when the animation is updated to the next frame.
Declaration
public event EventHandler Updated
Event Type
Type | Description |
---|---|
System.EventHandler |