Class Animatable

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.dll

    The class that represents an object capable of animation is the parent class of the minimum unit of visual, View. When a property is an animatable property, it means that its value can change continuously as the target of an animation. In this case, if a property notification callback is set, you can receive the callback according to the changing values. Additionally, users can also add their own properties.

    public class Animatable : BaseHandle, INotifyPropertyChanged, IDisposable
    Inheritance
    object
    BindableObject
    Tizen.NUI.Binding.Element
    BaseHandle
    Animatable
    Derived
    Container
    Container
    Renderer
    Renderer
    Shader
    Shader
    Implements
    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable
    Examples
         View view = new View()
         {
             Size2D = new Size2D(100, 100),
             Position2D = new Position2D(100, 100),
             BackgroundColor = Color.Red,
         };
    
         Window.Default.Add(view);
         Animation animation = new Animation();
         const float destinationValue = 300.0f;
         const int startTime = 0; // animation starts at 0 second point. no delay.
         const int endTime = 5000; // animation ends at 5 second point.
         animation.AnimateTo(view, "PositionX", destinationValue, startTime, endTime, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInSine));
         animation.Play();
    
         PropertyNotification propertyNotification = view.AddPropertyNotification("position", PropertyCondition.Step(10.0f));
         propertyNotification.Notified += (object source, PropertyNotification.NotifyEventArgs args) =>
         {
             Animatable target = args.PropertyNotification.GetTarget();
             if (target is View viewTarget)
             {
                 Tizen.Log.Debug("NUI", $"postion changed! ({viewTarget.CurrentPosition.X},{viewTarget.CurrentPosition.Y})");
             }
         };
    
         Animatable animatable = new Animatable();
         int myPropertyIndex = animatable.RegisterProperty("myProperty", new PropertyValue(100), PropertyAccessMode.ReadWrite);
         animatable.GetProperty(myPropertyIndex).Get(out int aValue);
         Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 100)");
    
         animatable.SetProperty(myPropertyIndex, new PropertyValue(200));
         animatable.GetProperty(myPropertyIndex).Get(out aValue);
         Tizen.Log.Debug("NUI", $"myProperty value : {aValue} (should be 200)");

    Constructors

    View Source

    Animatable()

    Create an instance of animatable.

    Declaration
    public Animatable()

    Methods

    View Source

    AddPropertyNotification(string, PropertyCondition)

    Adds a property notification to this object.

    Declaration
    public PropertyNotification AddPropertyNotification(string property, PropertyCondition condition)
    Parameters
    Type Name Description
    string property

    The name of the property.

    PropertyCondition condition

    The notification will be triggered when this condition is satisfied.

    Returns
    Type Description
    PropertyNotification

    A handle to the newly created PropertyNotification.

    View Source

    GetProperty(int)

    Retrieves a property value.

    Declaration
    public PropertyValue GetProperty(int index)
    Parameters
    Type Name Description
    int index

    The index of the property.

    Returns
    Type Description
    PropertyValue

    The property value.

    View Source

    GetPropertyIndex(string)

    Queries the index of a property.

    Declaration
    public int GetPropertyIndex(string name)
    Parameters
    Type Name Description
    string name

    The name of the property.

    Returns
    Type Description
    int

    The index of the property.

    View Source

    GetPropertyName(int)

    Queries the name of a property.

    Declaration
    public string GetPropertyName(int index)
    Parameters
    Type Name Description
    int index

    The index of the property.

    Returns
    Type Description
    string

    The name of the property.

    View Source

    GetPropertyType(int)

    Queries the type of a property.

    Declaration
    public PropertyType GetPropertyType(int index)
    Parameters
    Type Name Description
    int index

    The index of the property.

    Returns
    Type Description
    PropertyType

    The type of the property.

    View Source

    IsPropertyAnimatable(int)

    whether a writable property can be the target of an animation.

    Declaration
    public bool IsPropertyAnimatable(int index)
    Parameters
    Type Name Description
    int index

    The index of the property.

    Returns
    Type Description
    bool

    True if the property is animatable.

    View Source

    IsPropertyWritable(int)

    Queries whether a property can be writable.

    Declaration
    public bool IsPropertyWritable(int index)
    Parameters
    Type Name Description
    int index

    The index of the property.

    Returns
    Type Description
    bool

    True if the property is writable.

    View Source

    RegisterProperty(string, PropertyValue, PropertyAccessMode)

    Registers a new animatable property.

    Declaration
    public int RegisterProperty(string name, PropertyValue propertyValue, PropertyAccessMode accessMode)
    Parameters
    Type Name Description
    string name

    The name of the property.

    PropertyValue propertyValue

    The new value of the property.

    PropertyAccessMode accessMode

    The property access mode (writable, animatable etc).

    Returns
    Type Description
    int

    The type of the property.

    View Source

    RegisterProperty(string, PropertyValue)

    Registers a new animatable property.

    Declaration
    public int RegisterProperty(string name, PropertyValue propertyValue)
    Parameters
    Type Name Description
    string name

    The name of the property.

    PropertyValue propertyValue

    The new value of the property.

    Returns
    Type Description
    int

    The type of the property.

    View Source

    RemovePropertyNotification(PropertyNotification)

    Removes a property notification from this object.

    Declaration
    public void RemovePropertyNotification(PropertyNotification propertyNotification)
    Parameters
    Type Name Description
    PropertyNotification propertyNotification

    The propertyNotification to be removed.

    View Source

    RemovePropertyNotifications()

    Removes a property notification from this object.

    Declaration
    public void RemovePropertyNotifications()
    View Source

    SetProperty(int, PropertyValue)

    Sets the value of an existing property.

    Declaration
    public void SetProperty(int index, PropertyValue propertyValue)
    Parameters
    Type Name Description
    int index

    The index of the property.

    PropertyValue propertyValue

    The new value of the property.

    Implements

    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX