public InteractionButton() { InitializeComponent(); makeVisible = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(0.5))); makeInvisible = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(0.5))); popupCloseTimer = new Timer(onTimer,null, -1, -1); Loaded += onLoaded; }
public void Start(object source) { //WPF objects MUST be created on the goddamn dispatcher thread, otherwise you run into trouble makeVisible = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromSeconds(Duration))); makeInvisible = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromSeconds(Duration))); openingSource = source as UIElement; if (openingSource == null) return; openingSource.BeginAnimation(UIElement.OpacityProperty, makeVisible); }
public AnimationObserver(WorkingBar bar, DoubleAnimationBase animation) { this.bar = bar; this.animation = animation; this.animation.Completed += OnAnimationCompleted; }