wpf中防止界面卡死的写法

原文: wpf中防止界面卡死的写法

View Code
   
   
this .button1.Content = " 正在计算 " ;
Action action
= new Action(() => {
System.Threading.Thread.Sleep(
3000 );
this .Dispatcher.BeginInvoke( new Action(() =>
{
this .button1.Content = " 计算完毕 " ;
}), System.Windows.Threading.DispatcherPriority.SystemIdle,
null );
});
action.BeginInvoke(
null , null );

猜你喜欢

转载自www.cnblogs.com/lonelyxmas/p/9055305.html
今日推荐