projects/wms-framework/src/lib/helpers/Animation.ts
Keyframe collection of double property values
PresentationFrameworkCollectionModel
Private innerCollection |
Default value : new SimpleList<T>()
|
Inherited from
PresentationFrameworkCollectionModel
|
Defined in
PresentationFrameworkCollectionModel:446
|
Protected bindingExpressions |
Default value : new SimpleDictionary<
string,
BindingExpression
>()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:65
|
Public BindingValidationError |
Default value : new SubscriptionEvent<
(sender: any, e: BindingValidationErrorEventArgs) => void
>()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:78
|
Event for validation errors |
Public change |
Type : SubscriptionEvent<void>
|
Default value : new SubscriptionEvent()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:61
|
Infrastructure event for notifying event changes |
Public Dispatcher |
Type : Dispatcher
|
Default value : Dispatcher.GetDispatcher()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:55
|
isEnableSetPropertiesRegistry |
Type : boolean
|
Default value : true
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:125
|
Flag which indicates if the dependency property set mechanism is enable |
Public IsInitializingBindings |
Type : boolean
|
Default value : false
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:178
|
Property to determine if bindings are being initialized |
previousValidationMessage |
Type : string
|
Default value : ''
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:70
|
Protected properties |
Type : object
|
Default value : {}
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:64
|
Private setPropertiesRegistry |
Type : Map<string | boolean>
|
Default value : new Map()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:116
|
Registry with dependencies properties which has been set |
validationerr |
Default value : false
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:69
|
validationMessagesStack |
Type : Array<>
|
Default value : []
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:106
|
Keeps a queue of validation messages registered on the current Dependency Object |
add | ||||||
add(value: T)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:481
|
||||||
Parameters :
Returns :
void
|
clear |
clear()
|
Inherited from
PresentationFrameworkCollectionModel
|
Defined in
PresentationFrameworkCollectionModel:505
|
Returns :
void
|
contains | ||||||
contains(value: T)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:513
|
||||||
Parameters :
Returns :
boolean
|
copyTo | |||||||||
copyTo(target: T[], index: number)
|
|||||||||
Inherited from
PresentationFrameworkCollectionModel
|
|||||||||
Defined in
PresentationFrameworkCollectionModel:523
|
|||||||||
Parameters :
Returns :
void
|
getItem | ||||||
getItem(index: number)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:447
|
||||||
Parameters :
Returns :
T
|
indexOf | ||||||
indexOf(value: T)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:456
|
||||||
Parameters :
Returns :
number
|
insert | |||||||||
insert(index: number, value: T)
|
|||||||||
Inherited from
PresentationFrameworkCollectionModel
|
|||||||||
Defined in
PresentationFrameworkCollectionModel:460
|
|||||||||
Parameters :
Returns :
void
|
internalAdd | ||||||
internalAdd(value: T)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:492
|
||||||
Add used for internal processing of added elements to collection without trigger change
Parameters :
Returns :
void
|
remove | ||||||
remove(value: T)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:517
|
||||||
Parameters :
Returns :
boolean
|
removeAt | ||||||
removeAt(index: number)
|
||||||
Inherited from
PresentationFrameworkCollectionModel
|
||||||
Defined in
PresentationFrameworkCollectionModel:465
|
||||||
Parameters :
Returns :
void
|
setItem | |||||||||
setItem(index: number, value: T)
|
|||||||||
Inherited from
PresentationFrameworkCollectionModel
|
|||||||||
Defined in
PresentationFrameworkCollectionModel:451
|
|||||||||
Parameters :
Returns :
void
|
sort |
sort()
|
Inherited from
PresentationFrameworkCollectionModel
|
Defined in
PresentationFrameworkCollectionModel:473
|
Returns :
any
|
()
|
Inherited from
PresentationFrameworkCollectionModel
|
Defined in
PresentationFrameworkCollectionModel:526
|
Returns :
Iterator<T, any, undefined>
|
Private addRelatedSubscriptionIfRequired | ||||||||||||
addRelatedSubscriptionIfRequired(event: SubscriptionEvent<any>, theHandler: any, bindingExpression: BindingExpression)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:502
|
||||||||||||
Parameters :
Returns :
void
|
Private addSubscriptionForTwoWayBindings | ||||||||||||
addSubscriptionForTwoWayBindings(dependencyProperty: DependencyProperty, binding: Binding, bindingExpression: BindingExpression)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:383
|
||||||||||||
Parameters :
Returns :
void
|
addsValidationMessage | |||||||||
addsValidationMessage(propKey: Binding | string, message: string)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:135
|
|||||||||
Adds a new validation message associated to a binding or a property name
Parameters :
Returns :
void
|
Private beginSubscribeToMultiPropertyPathChanges | |||||||||||||||
beginSubscribeToMultiPropertyPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
|
|||||||||||||||
Inherited from
DependencyObject
|
|||||||||||||||
Defined in
DependencyObject:542
|
|||||||||||||||
Parameters :
Returns :
void
|
Private checkForSubscriptoinToDataErrorInfo | |||||||||||||||
checkForSubscriptoinToDataErrorInfo(currentContext: any, binding: Binding, propertyToSubscribe: string, bindingExpression: BindingExpression)
|
|||||||||||||||
Inherited from
DependencyObject
|
|||||||||||||||
Defined in
DependencyObject:716
|
|||||||||||||||
Parameters :
Returns :
void
|
Public clearValue | ||||||
clearValue(property: DependencyProperty)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:212
|
||||||
Clears the dependency property value
Parameters :
Returns :
void
|
Equals | ||||||
Equals(obj: any)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:201
|
||||||
Compares this dependency object agains another object.
Parameters :
Returns :
boolean
{boolean} |
GetChild | ||||||
GetChild(idx: number)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:928
|
||||||
Gets the child element at the index position
Parameters :
Returns :
DependencyObject
{DependencyObject} |
GetChildrenCount |
GetChildrenCount()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:916
|
Method o know the amount of children the parent has
Returns :
number
{number} |
GetHashCode |
GetHashCode()
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:187
|
Gets a hash code for this dependency object.
Returns :
number
{number} |
Public getValue | ||||||
getValue(property: DependencyProperty)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:226
|
||||||
Gets the value of a dependency property
Parameters :
Returns :
any
|
Private handleErrorsOnContext | |||||||||
handleErrorsOnContext(errorCtxt: INotifyDataErrorInfo, args: DataErrorsChangedEventArgs)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:777
|
|||||||||
Check and register possible errors in an error context
Parameters :
Returns :
void
|
Public IsPropertySet | ||||||
IsPropertySet(propertyName: string)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:376
|
||||||
Indicates if the property has been already set.
Parameters :
Returns :
any
|
Private performDataErrorValidationIfRequired |
performDataErrorValidationIfRequired(binding: Binding, theBindingContext: any)
|
Inherited from
DependencyObject
|
Defined in
DependencyObject:481
|
Performs validation on model if the model implementes IDataErrorINfo
Returns :
void
|
Private performRemoveValidationIfInValidationError | ||||||
performRemoveValidationIfInValidationError(binding: Binding)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:461
|
||||||
Performs the remove validation if the InValidationError is true
Parameters :
Returns :
void
|
Public performTargetObjectBindingUpdate | |||||||||
performTargetObjectBindingUpdate(dependencyProperty: DependencyProperty, binding: Binding)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:429
|
|||||||||
Updates the target object value associated to the binding.
Parameters :
Returns :
void
|
Private preprocessValue | |||||||||
preprocessValue(property: DependencyProperty, value: any)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:889
|
|||||||||
Preprocess value to be set to dependency property
Parameters :
Returns :
any
|
Private recreateSubscriptionsForMultiPropertyBindingPath | ||||||||||||||||||||||||
recreateSubscriptionsForMultiPropertyBindingPath(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
|
||||||||||||||||||||||||
Inherited from
DependencyObject
|
||||||||||||||||||||||||
Defined in
DependencyObject:682
|
||||||||||||||||||||||||
Parameters :
Returns :
void
|
Private registerSetPropertyIfRequired | ||||||
registerSetPropertyIfRequired(name: string)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:903
|
||||||
Register set property if required
Parameters :
Returns :
void
|
Private removeSubscriptionsForMultiPropertyBindingPath | |||||||||
removeSubscriptionsForMultiPropertyBindingPath(subscriptionsForCurrentBindingPath: [], propertyIndex: number)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:663
|
|||||||||
Parameters :
Returns :
void
|
removeValidationMessage | ||||||
removeValidationMessage(propKey: Binding | string)
|
||||||
Inherited from
DependencyObject
|
||||||
Defined in
DependencyObject:158
|
||||||
Removes a validation message associated to a binding or a property name
Parameters :
Returns :
void
|
SetBinding | ||||||||||||
SetBinding(dependencyProperty: DependencyProperty, binding: Binding)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:317
|
||||||||||||
Sets a binding to the specified property at runtime
Parameters :
Returns :
void
|
Public setValue | |||||||||
setValue(property: DependencyProperty, value: any)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:249
|
|||||||||
Sets the value for a dependency property
Parameters :
Returns :
void
|
Public setValueForScopedRegion | ||||||||||||
setValueForScopedRegion(property: DependencyProperty, value: any, scopedRegionManager: IRegionManager)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:282
|
||||||||||||
Sets the value for a dependency property. This is a workaround to support Scoped Region Managers. A research is required to find out the way to get the application region Manager when scoped region managers are used (when creating the DelayedRegionBehavior, the correct scoped region manager must be passed as an argument).
Parameters :
Returns :
void
|
Protected shouldPreventDefaultSourceUpdate | |||||||||
shouldPreventDefaultSourceUpdate(dependencyProperty: DependencyProperty, binding: BindingExpression)
|
|||||||||
Inherited from
DependencyObject
|
|||||||||
Defined in
DependencyObject:870
|
|||||||||
Parameters :
Returns :
boolean
|
Private subscribeToBindingPathChanges | |||||||||||||||
subscribeToBindingPathChanges(context: any, binding: Binding, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression)
|
|||||||||||||||
Inherited from
DependencyObject
|
|||||||||||||||
Defined in
DependencyObject:512
|
|||||||||||||||
Parameters :
Returns :
void
|
Private subscribeToErrorsChangedInModel | ||||||||||||
subscribeToErrorsChangedInModel(errorCtxt: INotifyDataErrorInfo, propertyToSubscribe: string, bindingExpression: BindingExpression)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:748
|
||||||||||||
Parameters :
Returns :
void
|
Private subscribeToPropertyChanges | ||||||||||||||||||||||||
subscribeToPropertyChanges(currentContext: any, outerContext: any, properties: string[], propertyIndex: number, dependencyProperty: DependencyProperty, bindingExpression: BindingExpression, subscriptionsForCurrentBindingPath: Array<>)
|
||||||||||||||||||||||||
Inherited from
DependencyObject
|
||||||||||||||||||||||||
Defined in
DependencyObject:586
|
||||||||||||||||||||||||
Parameters :
Returns :
void
|
Private updateSourceOfBinding | ||||||||||||
updateSourceOfBinding(binding: Binding, outerContext: any, dependencyProperty: DependencyProperty)
|
||||||||||||
Inherited from
DependencyObject
|
||||||||||||
Defined in
DependencyObject:811
|
||||||||||||
Updates the source of a binding
Parameters :
Returns :
void
|
import { SubscriptionEvent } from '../utils/SubscriptionEvent';
import { DependencyObject } from '../basecomponentmodel/DependencyObject';
import { PresentationFrameworkCollectionModel } from '../models/controls/ItemsControlModel';
import { PropertyPath } from '../basecomponentmodel/Bindings/PropertyPath';
import { DependencyProperty } from '../basecomponentmodel/DependencyProperty';
import { TimeRange } from '../baseframework/TimeRange';
/**
* Base class for timeline objets
*
* @export
* @abstract
* @class TimelineModel
* @extends {DependencyObject}
* @wType System.Windows.Media.Animation.Timeline
*/
export abstract class TimelineModel extends DependencyObject {
/**
* Start time
*
* @type {TimeRange}
* @memberof TimelineModel
*/
BeginTime: TimeRange;
/**
* Creates an instance of TimelineModel.
*
* @memberof TimelineModel
*/
constructor() {
super();
this.Completed = new SubscriptionEvent<any>();
}
/**
* Executes the animation frames
*
* @abstract
* @memberof TimelineModel
* @wIgnore
*/
Execute(): void {
// Not required implementation for abstract class.
}
/**
* Event to be triggered when the storyboard completes
*
* @type {SubscriptionEvent<any>}
* @memberof TimelineModel
*/
public Completed: SubscriptionEvent<any>;
}
/**
* Storyboard compatibility class
*
* @export
* @class Storyboard
* @extends {DependencyObject}
* @wType System.Windows.Media.Animation.Storyboard
*/
export class Storyboard extends TimelineModel {
/**
* Property information for the `Target` property
*
* @static
* @memberof Storyboard
* @wIgnore
*/
public static readonly TargetProperty = new DependencyProperty(
'Target',
null,
null
);
/**
* Property information for the `TargetProperty` property
*
* @static
* @memberof Storyboard
*/
public static readonly TargetPropertyProperty = new DependencyProperty(
'TargetProperty',
null,
null
);
/**
* Storyboard name
*
* @type {string}
* @memberof Storyboard
* @wIgnore
*/
public Name: string = null;
/**
* Begin time
*
* @type {TimeRange}
* @memberof Storyboard
* @wIgnore
*/
public BeginTime: TimeRange = new TimeRange();
/**
* Children of this storyboard
*
* @type {PresentationFrameworkCollectionModel<TimelineModel>}
* @memberof Storyboard
*/
public readonly Children: PresentationFrameworkCollectionModel<TimelineModel> =
new TimelineCollection();
/**
* current request for animation
*
* @private
* @type {number}
* @memberof Storyboard
*/
private animationId: any = null;
/**
* Creates an instance of Storyboard.
*
* @memberof Storyboard
*/
constructor() {
super();
}
/**
* Gets the value of the `Target` property
*
* @static
* @param {TimelineModel} obj
* @return {*} {*}
* @memberof Storyboard
* @wIgnore
*/
static GetTarget(obj: TimelineModel): any {
return obj.getValue(Storyboard.TargetProperty);
}
/**
* Sets the value of the `Target` property
*
* @static
* @param {TimelineModel} obj
* @param {*} target
* @memberof Storyboard
*/
public static SetTarget(obj: TimelineModel, target: any) {
obj.setValue(Storyboard.TargetProperty, target);
}
/**
* Gets the value of the `TargetProperty` property
*
* @static
* @param {TimelineModel} obj
* @return {*} {PropertyPath}
* @memberof Storyboard
*/
static GetTargetProperty(obj: TimelineModel): PropertyPath {
return obj.getValue(Storyboard.TargetPropertyProperty);
}
/**
* Sets the value of the `TargetProperty` property
*
* @static
* @param {*} obj
* @param {PropertyPath} targetProperty
* @memberof Storyboard
*/
public static SetTargetProperty(obj: any, targetProperty: PropertyPath) {
obj.setValue(Storyboard.TargetPropertyProperty, targetProperty);
}
/**
* Starts the animation logic
*
* @memberof Storyboard
*/
public Begin() {
this.animationId = setTimeout(() => {
for (const obj of this.Children) {
obj.Execute();
}
this.Completed.fire(null);
this.animationId = null;
clearTimeout(this.animationId);
});
}
/**
* Stops the current animation
*
* @memberof Storyboard
*/
public Stop() {
if (this.animationId !== null) {
clearTimeout(this.animationId);
this.animationId = null;
}
}
/**
* Sets the name of the current storyboard object
*
* @param {string} name
* @return {*} {Storyboard}
* @memberof Storyboard
*/
public withName(name: string): Storyboard {
this.Name = name;
return this;
}
}
/**
* Collection of timeline objects
*
* @export
* @class TimelineCollection
* @extends {PresentationFrameworkCollectionModel<TimelineModel>}
* @wType System.Windows.Media.Animation.TimelineCollection
*/
export class TimelineCollection extends PresentationFrameworkCollectionModel<TimelineModel> {}
/**
* Keytime
*
* @export
* @class KeyTime
* @wType System.Windows.Media.Animation.KeyTime
*/
export class KeyTime {
/**
* Time mark
*
* @type {TimeRange}
* @memberof KeyTime
* @wProperty TimeSpan
*/
TimeRange: TimeRange;
/**
* Creates an instance of the current `KeyTime` class
*
* @static
* @param {TimeRange} timeRange
* @return {*} {KeyTime}
* @memberof KeyTime
*/
public static FromTimeSpan(timeRange: TimeRange): KeyTime {
const result = new KeyTime();
result.TimeRange = timeRange;
return result;
}
/**
* Parse a time range string into a `KeyTime`.
*
* The format for the input is `dd.hh:mm:ss.ff`, where:
* - `dd` = days - optional
* - `hh` = hours - mandatory
* - `mm` = minutes - optional
* - `ss` = seconds - optional
* - `ff` = fractionalSeconds - optional
*
* Valid input examples are:
* - `1.2:3:4.5` = 1 day, 2 hours, 3 minutes, 4 seconds, 500 milliseconds.
* - `02:30` = 2 hours, 30 minutes.
* - `3.2:15` = 3 days, 2 hours, 15 minutes.
* - `13` = *special* - this is interpreted as 13 days, not 13 hours.
*
* Invalid input values:
* - `1.2` = ambiguous input. It could mean 1 day and 2 hours, or 1 second and 200 milliseconds.
* - `15:52.3` = 15 minutes, 52 seconds and 300 milliseconds. Is invalid because hours is mandatory.
* - `3:14:` = lacks seconds. In general, a number should always follow `:` or `.`.
*
* @static
* @param {string} input
* @return {*} {KeyTime}
* @memberof KeyTime
* @wIgnore
*/
public static Parse(input: string): KeyTime {
return KeyTime.FromTimeSpan(TimeRange.Parse(input));
}
}
/**
* Keyframe for object values
*
* @export
* @class ObjectKeyFrame
* @wType System.Windows.Media.Animation.ObjectKeyFrame
*/
export class ObjectKeyFrame {
/**
* Time mark
*
* @type {KeyTime}
* @memberof ObjectKeyFrame
*/
KeyTime: KeyTime;
/**
* Value to set in this keyframe
*
* @type {unknown}
* @memberof ObjectKeyFrame
*/
Value: unknown;
}
/**
* Double value keyframe
*
* @export
* @class DoubleKeyFrame
* @wType System.Windows.Media.Animation.DoubleKeyFrame
*/
export class DoubleKeyFrame {
/**
* Time mark
*
* @type {KeyTime}
* @memberof DoubleKeyFrame
*/
KeyTime: KeyTime;
/**
* Double value to set
*
* @type {number}
* @memberof DoubleKeyFrame
*/
Value: number;
}
/**
* Double (easing) keyframe
*
* @export
* @class EasingDoubleKeyFrame
* @extends {DoubleKeyFrame}
* @wType System.Windows.Media.Animation.EasingDoubleKeyFrame
*/
export class EasingDoubleKeyFrame extends DoubleKeyFrame {}
/**
* Keyframe for object properties
*
* @export
* @class DiscreteObjectKeyFrame
* @extends {ObjectKeyFrame}
* @wType System.Windows.Media.Animation.DiscreteObjectKeyFrame
*/
export class DiscreteObjectKeyFrame extends ObjectKeyFrame {}
/**
* Keyframe collection of object properties
*
* @export
* @class ObjectKeyFrameCollection
* @extends {PresentationFrameworkCollectionModel<ObjectKeyFrame>}
* @wType System.Windows.Media.Animation.ObjectKeyFrameCollection
*/
export class ObjectKeyFrameCollection extends PresentationFrameworkCollectionModel<ObjectKeyFrame> {}
/**
* Keyframe collection of double property values
*
* @export
* @class DoubleKeyFrameCollection
* @extends {PresentationFrameworkCollectionModel<DoubleKeyFrame>}
* @wType System.Windows.Media.Animation.DoubleKeyFrameCollection
*/
export class DoubleKeyFrameCollection extends PresentationFrameworkCollectionModel<DoubleKeyFrame> {}
/**
* Animation using object properties and keyframes
*
* @export
* @class ObjectAnimationUsingKeyFrames
* @extends {TimelineModel}
* @wType System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames
*/
export class ObjectAnimationUsingKeyFrames extends TimelineModel {
/**
* Collection of keyframes
*
* @memberof ObjectAnimationUsingKeyFrames
*/
KeyFrames = new ObjectKeyFrameCollection();
/**
* Executes the current animation
*
* @memberof ObjectAnimationUsingKeyFrames
* @wIgnore
*/
Execute() {
const obj = Storyboard.GetTarget(this);
const path = Storyboard.GetTargetProperty(this);
if (path) {
for (const keyFrame of this.KeyFrames) {
path.setValueContextObject(obj, keyFrame.Value);
}
}
}
}
/**
* Animation of double
*
* @export
* @class DoubleAnimationUsingKeyFrames
* @wType System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames
*/
export class DoubleAnimationUsingKeyFrames extends TimelineModel {
/**
* Collection of keyframes
*
* @memberof DoubleKeyFrameCollection
*/
KeyFrames = new DoubleKeyFrameCollection();
/**
* Executes the current animation
*
* @memberof ObjectAnimationUsingKeyFrames
* @wIgnore
*/
Execute() {
const obj = Storyboard.GetTarget(this);
const path = Storyboard.GetTargetProperty(this);
if (path) {
for (const keyFrame of this.KeyFrames) {
path.setValueContextObject(obj, keyFrame.Value);
}
}
}
}
/**
* Duration object
*
* @export
* @class Duration
* @wType System.Windows.Duration
*/
export class Duration {
/**
* Automatic duration
*
* @static
* @type {Duration}
* @memberof Duration
*/
public static Automatic: Duration = new Duration(undefined);
/**
* 'Forever' duration
*
* @static
* @type {Duration}
* @memberof Duration
*/
public static Forever: Duration = new Duration(undefined);
/**
* Duration time
*
* @type {TimeRange}
* @memberof Duration
*/
public TimeSpan: TimeRange = new TimeRange();
/**
* Verifies if this object has time
*
* @readonly
* @memberof Duration
*/
public get HasTimeSpan() {
return typeof this.TimeSpan !== 'undefined';
}
/**
* Creates an instance of Duration.
* @param {TimeRange} time
* @memberof Duration
*/
constructor(time: TimeRange) {
this.TimeSpan = time;
}
}