public override bool Evaluate(RadObject target) { if (target == null) { return(false); } switch (this.UnaryOperator) { case UnaryOperator.None: return(target.GetValue(this.Setting.Property).Equals(this.Setting.GetCurrentValue(target))); case UnaryOperator.NotOperator: return(!target.GetValue(this.Setting.Property).Equals(this.Setting.GetCurrentValue(target))); default: return(false); } }
/// <summary> /// /// </summary> /// <returns></returns> public object GetValue() { RadObject source = this.SourceObject; if (source != null) { return(source.GetValue(this.sourceProperty)); } return(null); }
public void ApplyValue(RadObject element) { this.RemovePreviousAnimation(element); if (!this.IsAnimationEnabled(element)) { this.OnAnimationStarted(new AnimationStatusEventArgs(element, false)); this.OnAnimationFinished(new AnimationStatusEventArgs(element, true, !this.RemoveAfterApply)); } else { ElementValuesAnimator animator = this.GetAnimator(element); animator.Initialize(element, this.startValue != null ? this.startValue : element.GetValue(this.Property)); if (this.RandomDelay != 0) { this.ApplyDelay = AnimatedPropertySetting.rand.Next(this.RandomDelay); } if (this.ApplyDelay > 0) { animator.Waiting = true; Timer timer = new Timer(); timer.Interval = this.ApplyDelay; timer.Tick += new EventHandler(this.delayTimer_Tick); timer.Tag = (object)element; timer.Start(); } else { this.OnAnimationStarted(new AnimationStatusEventArgs(element, false)); animator.Start(element); } } }