public static void BeginAnimation(ChartArea seriesHost, string propertyName, object currentValue, object targetValue, Action<object, object> propertyUpdateAction, Dictionary<string, StoryboardInfo> storyboards, TimeSpan timeSpan, IEasingFunction easingFunction)
 {
     if (timeSpan == TimeSpan.Zero)
         propertyUpdateAction(currentValue, targetValue);
     else
         DependencyPropertyAnimationHelper.CreateAnimation(seriesHost, propertyName, currentValue, targetValue, propertyUpdateAction, storyboards, timeSpan, easingFunction).Begin();
 }
Esempio n. 2
0
 public SelectionPanel(ChartArea chartArea)
 {
     this._pathAdornersPool = new PanelElementPool<SelectionAdorner, Geometry>((Panel)this, new Func<SelectionAdorner>(this.CreatePathAdorner), new Action<SelectionAdorner, Geometry>(this.InitializePathAdorner), new Action<SelectionAdorner>(this.ResetPathAdorner));
     this.ChartArea = chartArea;
     this.ChartArea.PropertyChanged += new PropertyChangedEventHandler(this.ChartArea_PropertyChanged);
     this.ChartArea.KeyDown += new KeyEventHandler(this.ChartArea_KeyDown);
 }
 public static Storyboard CreateAnimation(ChartArea seriesHost, string propertyName, object currentValue, object targetValue, Action<object, object> propertyUpdateAction, Dictionary<string, StoryboardInfo> storyboards, TimeSpan timeSpan, IEasingFunction easingFunction)
 {
     ObjectPool<PropertyAnimator, object> propertyAnimatorPool = (ObjectPool<PropertyAnimator, object>)seriesHost.SingletonRegistry.GetSingleton((object)"__PropertyAnimatorPool__", (Func<object>)(() => (object)new ObjectPool<PropertyAnimator, object>((Func<PropertyAnimator>)(() => new PropertyAnimator()), (Action<PropertyAnimator, object>)((obj, context) => obj.AnimatedValue = context), (Action<PropertyAnimator>)(obj => obj.UpdateAction = (Action<object, object>)null))), (Action<object>)(obj => ((ObjectPool<PropertyAnimator, object>)obj).ReleaseAll()));
     PropertyAnimator propertyAnimator = propertyAnimatorPool.Get(currentValue);
     propertyAnimator.UpdateAction = propertyUpdateAction;
     Action releaseAction = (Action)(() =>
        {
        propertyAnimatorPool.Release(propertyAnimator);
        propertyAnimatorPool.AdjustPoolSize();
        });
     return DependencyPropertyAnimationHelper.CreateAnimation((DependencyObject)propertyAnimator, storyboards, PropertyAnimator.AnimatedValueProperty, "AnimatedValue", propertyName, currentValue, targetValue, timeSpan, easingFunction, releaseAction);
 }
Esempio n. 4
0
 protected virtual void OnChartAreaPropertyChanged(ChartArea oldValue, ChartArea newValue)
 {
     if (oldValue != null && oldValue.PaletteDispenser != null)
         oldValue.PaletteDispenser.PaletteChanged -= new EventHandler(this.PaletteChanged);
     if (newValue == null || newValue.PaletteDispenser == null)
         return;
     newValue.PaletteDispenser.PaletteChanged += new EventHandler(this.PaletteChanged);
 }
Esempio n. 5
0
 public ChartAreaAutomationPeer(ChartArea owner)
     : base((FrameworkElement)owner)
 {
 }