记录C#-WPF线程中如何修改值

new Thread(() =>

 {
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,

        new Action(() =>

        {

            Thread.Sleep(TimeSpan.FromSeconds(2));

            this.lblHello.Content = "欢迎你光临WPF的世界,Dispatche 异步方法!!"+ DateTime.Now.ToString();

        }));

 }).Start();

 

posted @ 2019-05-14 10:38  a3309548  阅读(397)  评论(0编辑  收藏  举报