winform            Thread th = new Thread(new ThreadStart(() =>
             {
                 for (int i = 0; i < 255; i++)
                 {
                     this.label1.Invoke(new Action(() => this.label1.BackColor = Color.FromArgb(i, i, i)));
                     Thread.Sleep(20);
                 }
             }));
            th.Start();
wpf            double d=1.0;
            Thread th = new Thread(new ThreadStart(() =>
                {
                    for (int i = 0; i < 10; i++)
                    {
                        this.lbl.Dispatcher.Invoke(() => this.lbl.Opacity = d);
                        d -= 0.1;
                        Thread.Sleep(200);
                    }
                }));
            th.Start();