private void drain_MouseEnter(object sender, MouseEventArgs e) { Animate(path14.Fill, MouseEnterBrush, path14); if (!Mute) { Animate(path16.Fill, MouseEnterBrush, path16); Animate(path18.Fill, MouseEnterBrush, path18); Animate(path20.Fill, MouseEnterBrush, path20); } else { Animate(Cross.Fill, MouseEnterBrush, Cross); } if (ShowVolumeBarOnMouseEnter) { Dispatcher.BeginInvoke(new Action(() => { ClearUC.Utils.AnimationHelper.Thickness ta = new ClearUC.Utils.AnimationHelper.Thickness(); ta.Animate(VolumeBar.Margin, new Thickness(0), 300, null, new PropertyPath(MarginProperty), VolumeBar); })); } timer.Stop(); }
private void AnimateItem(int Index, double ToLeft, bool RemoveWhenComplete = false) { _animating = true; FrameworkElement Element = Children[Index]; ClearUC.Utils.AnimationHelper.Thickness ta = new ClearUC.Utils.AnimationHelper.Thickness(); EventHandler <ClearUC.Utils.AnimationHelper.AnimationEventArgs> ev = null; ev = (sender, e) => { ta.AnimationCompleted -= ev; if (RemoveWhenComplete) { Parent.Children.Remove(Element); } _animating = false; }; ta.AnimationCompleted += ev; ta.Animate(Element.Margin, new Thickness(ToLeft, 0, -ToLeft, 0), Config.Current.Animation[Enums.Animation.MediaPanel], null, new PropertyPath(MarginProperty), Element); }
private void Timer_Tick(object sender, EventArgs e) { Dispatcher.BeginInvoke(new Action(() => { ClearUC.Utils.AnimationHelper.Thickness ta = new ClearUC.Utils.AnimationHelper.Thickness(); ta.Animate(VolumeBar.Margin, new Thickness(0, 0, ActualWidth - drain.ActualWidth, 0), 300, null, new PropertyPath(MarginProperty), VolumeBar); })); timer.Stop(); }