private void AnimateAddButton(bool open, Grid targetspacer, Grid addButtonGrid) { SettingsButton.BeginAnimation(OpacityProperty, open ? _opacityUp : _opacityDown); return; if (open && ((ScaleTransform)targetspacer.LayoutTransform).ScaleX == 1) { return; } if (!open && ((ScaleTransform)targetspacer.LayoutTransform).ScaleX == 0) { return; } var to = open ? 1 : 0; //var from = open ? 0 : 1; targetspacer.LayoutTransform.BeginAnimation(ScaleTransform.ScaleXProperty, new DoubleAnimation(to, TimeSpan.FromMilliseconds(250)) { EasingFunction = new QuadraticEase() }); addButtonGrid.BeginAnimation(OpacityProperty, new DoubleAnimation(to, TimeSpan.FromMilliseconds(250)) { EasingFunction = new QuadraticEase() }); }
private void OnWindowMouseLeave(object sender, MouseEventArgs e) { SettingsButton.BeginAnimation(OpacityProperty, _opacityDown); Task.Delay(1000).ContinueWith(t => Dispatcher.InvokeAsync(() => { if (IsMouseOver) { return; } AbnormalityIndicatorBase.InvokeVisibilityChanged(this, false); })); }
private void OnWindowMouseEnter(object sender, MouseEventArgs e) { AbnormalityIndicatorBase.InvokeVisibilityChanged(this, true); SettingsButton.BeginAnimation(OpacityProperty, _opacityUp); }
private void AnimateSettingsButton(bool open) { SettingsButton.BeginAnimation(OpacityProperty, open ? _opacityUp : _opacityDown); }