Artemis logo
Search Results for

    Show / Hide Table of Contents

    Class LayerProperty<T>

    Represents a property on a layer. Properties are saved in storage and can optionally be modified from the UI.

    Note: You cannot initialize layer properties yourself. If properly placed and annotated, the Artemis core will initialize these for you.

    Inheritance
    System.Object
    CorePropertyChanged
    LayerProperty<T>
    BoolLayerProperty
    ColorGradientLayerProperty
    EnumLayerProperty<T>
    FloatLayerProperty
    FloatRangeLayerProperty
    IntLayerProperty
    IntRangeLayerProperty
    LayerBrushReferenceLayerProperty
    SKColorLayerProperty
    SKPointLayerProperty
    SKSizeLayerProperty
    Implements
    ILayerProperty
    IStorageModel
    System.IDisposable
    Inherited Members
    CorePropertyChanged.PropertyChanged
    CorePropertyChanged.RequiresUpdate<T>(T, T)
    CorePropertyChanged.SetAndNotify<T>(T, T, String)
    CorePropertyChanged.OnPropertyChanged(String)
    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public class LayerProperty<T> : CorePropertyChanged, INotifyPropertyChanged, ILayerProperty, IStorageModel, IDisposable
    Type Parameters
    Name Description
    T

    The type of property encapsulated in this layer property

    Constructors

    | Improve this Doc View Source

    LayerProperty()

    Creates a new instance of the LayerProperty<T> class

    Declaration
    protected LayerProperty()

    Properties

    | Improve this Doc View Source

    BaseValue

    Gets or sets the base value of this layer property without any keyframes applied

    Declaration
    public T BaseValue { get; set; }
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    CurrentKeyframe

    Gets the current keyframe in the timeline according to the current progress

    Declaration
    public LayerPropertyKeyframe<T> CurrentKeyframe { get; protected set; }
    Property Value
    Type Description
    LayerPropertyKeyframe<T>
    | Improve this Doc View Source

    CurrentValue

    Gets the current value of this property as it is affected by it's keyframes, updated once every frame

    Declaration
    public T CurrentValue { get; set; }
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    DataBindingsSupported

    Gets whether data bindings are supported on this type of property

    Declaration
    public bool DataBindingsSupported { get; protected set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DefaultValue

    Gets or sets the default value of this layer property. If set, this value is automatically applied if the property has no value in storage

    Declaration
    public T DefaultValue { get; set; }
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    HasDataBinding

    Gets whether the layer has any active data bindings

    Declaration
    public bool HasDataBinding { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsHidden

    Gets or sets whether the property is hidden in the UI

    Declaration
    public bool IsHidden { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLoadedFromStorage

    Indicates whether the BaseValue was loaded from storage, useful to check whether a default value must be applied

    Declaration
    public bool IsLoadedFromStorage { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Keyframes

    Gets a read-only list of all the keyframes on this layer property

    Declaration
    public ReadOnlyCollection<LayerPropertyKeyframe<T>> Keyframes { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<LayerPropertyKeyframe<T>>
    | Improve this Doc View Source

    KeyframesEnabled

    Gets or sets whether keyframes are enabled on this property, has no effect if KeyframesSupported is False

    Declaration
    public bool KeyframesEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    KeyframesSupported

    Gets whether keyframes are supported on this type of property

    Declaration
    public bool KeyframesSupported { get; protected set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LayerPropertyGroup

    The parent group of this layer property, set after construction

    Declaration
    public LayerPropertyGroup LayerPropertyGroup { get; }
    Property Value
    Type Description
    LayerPropertyGroup
    | Improve this Doc View Source

    NextKeyframe

    Gets the next keyframe in the timeline according to the current progress

    Declaration
    public LayerPropertyKeyframe<T> NextKeyframe { get; protected set; }
    Property Value
    Type Description
    LayerPropertyKeyframe<T>
    | Improve this Doc View Source

    Path

    Gets the unique path of the property on the layer

    Declaration
    public string Path { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    ProfileElement

    Gets the profile element (such as layer or folder) this property is applied to

    Declaration
    public RenderProfileElement ProfileElement { get; }
    Property Value
    Type Description
    RenderProfileElement
    | Improve this Doc View Source

    PropertyDescription

    Gets the description attribute applied to this property

    Declaration
    public PropertyDescriptionAttribute PropertyDescription { get; }
    Property Value
    Type Description
    PropertyDescriptionAttribute
    | Improve this Doc View Source

    PropertyType

    Gets the type of the property

    Declaration
    public Type PropertyType { get; }
    Property Value
    Type Description
    System.Type

    Methods

    | Improve this Doc View Source

    AddKeyframe(LayerPropertyKeyframe<T>)

    Adds a keyframe to the layer property

    Declaration
    public void AddKeyframe(LayerPropertyKeyframe<T> keyframe)
    Parameters
    Type Name Description
    LayerPropertyKeyframe<T> keyframe

    The keyframe to add

    | Improve this Doc View Source

    AddKeyframeEntity(KeyframeEntity)

    Attempts to load and add the provided keyframe entity to the layer property

    Declaration
    public ILayerPropertyKeyframe AddKeyframeEntity(KeyframeEntity keyframeEntity)
    Parameters
    Type Name Description
    Artemis.Storage.Entities.Profile.KeyframeEntity keyframeEntity

    The entity representing the keyframe to add

    Returns
    Type Description
    ILayerPropertyKeyframe

    If succeeded the resulting keyframe, otherwise null

    | Improve this Doc View Source

    ApplyDefaultValue()

    Overrides the property value with the default value

    Declaration
    public void ApplyDefaultValue()
    | Improve this Doc View Source

    ClearDataBindingProperties()

    Removes all data binding properties so they are no longer available to the data binding system

    Declaration
    public void ClearDataBindingProperties()
    | Improve this Doc View Source

    DisableDataBinding<TProperty>(DataBinding<T, TProperty>)

    Disables the provided data binding

    Declaration
    public void DisableDataBinding<TProperty>(DataBinding<T, TProperty> dataBinding)
    Parameters
    Type Name Description
    DataBinding<T, TProperty> dataBinding

    The data binding to remove

    Type Parameters
    Name Description
    TProperty
    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Releases the unmanaged resources used by the object and optionally releases the managed resources.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    | Improve this Doc View Source

    EnableDataBinding<TProperty>(DataBindingRegistration<T, TProperty>)

    Enables a data binding for the provided dataBindingRegistration

    Declaration
    public DataBinding<T, TProperty> EnableDataBinding<TProperty>(DataBindingRegistration<T, TProperty> dataBindingRegistration)
    Parameters
    Type Name Description
    DataBindingRegistration<T, TProperty> dataBindingRegistration
    Returns
    Type Description
    DataBinding<T, TProperty>

    The newly created data binding

    Type Parameters
    Name Description
    TProperty
    | Improve this Doc View Source

    GetAllDataBindingRegistrations()

    Gets a list containing all data binding registrations of this layer property

    Declaration
    public List<IDataBindingRegistration> GetAllDataBindingRegistrations()
    Returns
    Type Description
    System.Collections.Generic.List<IDataBindingRegistration>

    A list containing all data binding registrations of this layer property

    | Improve this Doc View Source

    GetDataBindingRegistration<TProperty>(String)

    Gets a data binding registration by the display name used to register it

    Note: The expression must exactly match the one used to register the data binding

    Declaration
    public DataBindingRegistration<T, TProperty> GetDataBindingRegistration<TProperty>(string identifier)
    Parameters
    Type Name Description
    System.String identifier
    Returns
    Type Description
    DataBindingRegistration<T, TProperty>
    Type Parameters
    Name Description
    TProperty
    | Improve this Doc View Source

    Initialize(RenderProfileElement, LayerPropertyGroup, PropertyEntity, Boolean, PropertyDescriptionAttribute, String)

    Initializes the layer property

    Note: This isn't done in the constructor to keep it parameterless which is easier for implementations of LayerProperty<T>

    Declaration
    public void Initialize(RenderProfileElement profileElement, LayerPropertyGroup group, PropertyEntity entity, bool fromStorage, PropertyDescriptionAttribute description, string path)
    Parameters
    Type Name Description
    RenderProfileElement profileElement
    LayerPropertyGroup group
    Artemis.Storage.Entities.Profile.PropertyEntity entity
    System.Boolean fromStorage
    PropertyDescriptionAttribute description
    System.String path
    | Improve this Doc View Source

    IsHiddenWhen<TP>(TP, Func<TP, Boolean>)

    Set up a condition to hide the provided layer property when the condition evaluates to true

    Note: overrides previous calls to IsHiddenWhen and IsVisibleWhen

    Declaration
    public void IsHiddenWhen<TP>(TP layerProperty, Func<TP, bool> condition)
        where TP : ILayerProperty
    Parameters
    Type Name Description
    TP layerProperty

    The target layer property

    System.Func<TP, System.Boolean> condition

    The condition to evaluate to determine whether to hide the current layer property

    Type Parameters
    Name Description
    TP

    The type of the target layer property

    | Improve this Doc View Source

    IsVisibleWhen<TP>(TP, Func<TP, Boolean>)

    Set up a condition to show the provided layer property when the condition evaluates to true

    Note: overrides previous calls to IsHiddenWhen and IsVisibleWhen

    Declaration
    public void IsVisibleWhen<TP>(TP layerProperty, Func<TP, bool> condition)
        where TP : ILayerProperty
    Parameters
    Type Name Description
    TP layerProperty

    The target layer property

    System.Func<TP, System.Boolean> condition

    The condition to evaluate to determine whether to hide the current layer property

    Type Parameters
    Name Description
    TP

    The type of the target layer property

    | Improve this Doc View Source

    Load()

    Loads the model from its associated entity

    Declaration
    public void Load()
    | Improve this Doc View Source

    OnCurrentValueSet()

    Invokes the CurrentValueSet event

    Declaration
    protected virtual void OnCurrentValueSet()
    | Improve this Doc View Source

    OnDataBindingDisabled(LayerPropertyEventArgs)

    Invokes the DataBindingDisabled event

    Declaration
    protected virtual void OnDataBindingDisabled(LayerPropertyEventArgs e)
    Parameters
    Type Name Description
    LayerPropertyEventArgs e
    | Improve this Doc View Source

    OnDataBindingEnabled(LayerPropertyEventArgs)

    Invokes the DataBindingEnabled event

    Declaration
    protected virtual void OnDataBindingEnabled(LayerPropertyEventArgs e)
    Parameters
    Type Name Description
    LayerPropertyEventArgs e
    | Improve this Doc View Source

    OnDataBindingPropertiesCleared()

    Invokes the DataBindingDisabled event

    Declaration
    protected virtual void OnDataBindingPropertiesCleared()
    | Improve this Doc View Source

    OnDataBindingPropertyRegistered()

    Invokes the DataBindingPropertyRegistered event

    Declaration
    protected virtual void OnDataBindingPropertyRegistered()
    | Improve this Doc View Source

    OnInitialize()

    Called when the layer property has been initialized

    Declaration
    protected virtual void OnInitialize()
    | Improve this Doc View Source

    OnKeyframeAdded()

    Invokes the KeyframeAdded event

    Declaration
    protected virtual void OnKeyframeAdded()
    | Improve this Doc View Source

    OnKeyframeRemoved()

    Invokes the KeyframeRemoved event

    Declaration
    protected virtual void OnKeyframeRemoved()
    | Improve this Doc View Source

    OnKeyframesToggled()

    Invokes the KeyframesToggled event

    Declaration
    protected virtual void OnKeyframesToggled()
    | Improve this Doc View Source

    OnUpdated()

    Invokes the Updated event

    Declaration
    protected virtual void OnUpdated()
    | Improve this Doc View Source

    OnVisibilityChanged()

    Invokes the VisibilityChanged event

    Declaration
    protected virtual void OnVisibilityChanged()
    | Improve this Doc View Source

    RegisterDataBindingProperty<TProperty>(Func<TProperty>, Action<TProperty>, DataBindingConverter<T, TProperty>, String)

    Registers a data binding property so that is available to the data binding system

    Declaration
    public DataBindingRegistration<T, TProperty> RegisterDataBindingProperty<TProperty>(Func<TProperty> getter, Action<TProperty> setter, DataBindingConverter<T, TProperty> converter, string displayName)
    Parameters
    Type Name Description
    System.Func<TProperty> getter

    The function to call to get the value of the property

    System.Action<TProperty> setter

    The action to call to set the value of the property

    DataBindingConverter<T, TProperty> converter

    The converter to use while applying the data binding

    System.String displayName

    The display name of the data binding property

    Returns
    Type Description
    DataBindingRegistration<T, TProperty>
    Type Parameters
    Name Description
    TProperty

    The type of the layer property

    | Improve this Doc View Source

    RemoveKeyframe(LayerPropertyKeyframe<T>)

    Removes a keyframe from the layer property

    Declaration
    public void RemoveKeyframe(LayerPropertyKeyframe<T> keyframe)
    Parameters
    Type Name Description
    LayerPropertyKeyframe<T> keyframe

    The keyframe to remove

    | Improve this Doc View Source

    Save()

    Saves the property to the underlying property entity

    Declaration
    public void Save()
    | Improve this Doc View Source

    SetCurrentValue(T, Nullable<TimeSpan>)

    Sets the current value, using either keyframes if enabled or the base value.

    Declaration
    public void SetCurrentValue(T value, TimeSpan? time)
    Parameters
    Type Name Description
    T value

    The value to set.

    System.Nullable<System.TimeSpan> time

    An optional time to set the value add, if provided and property is using keyframes the value will be set to an new or existing keyframe.

    | Improve this Doc View Source

    Update(Timeline)

    Updates the layer properties internal state

    Declaration
    public void Update(Timeline timeline)
    Parameters
    Type Name Description
    Timeline timeline

    The timeline to apply to the property

    | Improve this Doc View Source

    UpdateCurrentValue(Single, Single)

    Called every update (if keyframes are both supported and enabled) to determine the new CurrentValue based on the provided progress

    Declaration
    protected virtual void UpdateCurrentValue(float keyframeProgress, float keyframeProgressEased)
    Parameters
    Type Name Description
    System.Single keyframeProgress

    The linear current keyframe progress

    System.Single keyframeProgressEased

    The current keyframe progress, eased with the current easing function

    Events

    | Improve this Doc View Source

    CurrentValueSet

    Occurs when the current value of the layer property was updated by some form of input

    Declaration
    public event EventHandler<LayerPropertyEventArgs> CurrentValueSet
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    DataBindingDisabled

    Occurs when a data binding has been disabled

    Declaration
    public event EventHandler<LayerPropertyEventArgs> DataBindingDisabled
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    DataBindingEnabled

    Occurs when a data binding has been enabled

    Declaration
    public event EventHandler<LayerPropertyEventArgs> DataBindingEnabled
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    DataBindingPropertiesCleared

    Occurs when all data binding properties have been removed

    Declaration
    public event EventHandler<LayerPropertyEventArgs> DataBindingPropertiesCleared
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    DataBindingPropertyRegistered

    Occurs when a data binding property has been added

    Declaration
    public event EventHandler<LayerPropertyEventArgs> DataBindingPropertyRegistered
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    Disposed

    Occurs when the layer property is disposed

    Declaration
    public event EventHandler Disposed
    Event Type
    Type Description
    System.EventHandler
    | Improve this Doc View Source

    KeyframeAdded

    Occurs when a new keyframe was added to the layer property

    Declaration
    public event EventHandler<LayerPropertyEventArgs> KeyframeAdded
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    KeyframeRemoved

    Occurs when a keyframe was removed from the layer property

    Declaration
    public event EventHandler<LayerPropertyEventArgs> KeyframeRemoved
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    KeyframesToggled

    Occurs when keyframes are enabled/disabled

    Declaration
    public event EventHandler<LayerPropertyEventArgs> KeyframesToggled
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    Updated

    Occurs once every frame when the layer property is updated

    Declaration
    public event EventHandler<LayerPropertyEventArgs> Updated
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>
    | Improve this Doc View Source

    VisibilityChanged

    Occurs when the visibility value of the layer property was updated

    Declaration
    public event EventHandler<LayerPropertyEventArgs> VisibilityChanged
    Event Type
    Type Description
    System.EventHandler<LayerPropertyEventArgs>

    Implements

    ILayerProperty
    IStorageModel
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX