public MainWindow() { InitializeComponent(); DoubleAnimation da = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(0.4))); WinCronTab.BeginAnimation(UIElement.OpacityProperty, da); InitialTray(); //最小化至托盘 timer.Tick += new EventHandler(timer_Tick); timer.Start(); }
private void BtnClose_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { System.Timers.Timer time = new System.Timers.Timer(400); time.Elapsed += new System.Timers.ElapsedEventHandler(MainClose); time.AutoReset = false; time.Enabled = true; DoubleAnimation da = new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.4))); WinCronTab.BeginAnimation(UIElement.OpacityProperty, da); }