private void BtnTest_Click(object sender, RoutedEventArgs e) { MyFontAnimation animation = new MyFontAnimation(); animation.Duration = TimeSpan.FromMilliseconds(5000); animation.From = 18.0; animation.To = 9.0; btnTest.BeginAnimation(Button.FontSizeProperty, animation); }
public SecondWindow() { InitializeComponent(); this.Loaded += (sender, e) => { MyFontAnimation animation = new MyFontAnimation(); animation.Duration = TimeSpan.FromMilliseconds(5000); btnTest.BeginAnimation(Button.FontSizeProperty, animation); }; }