香港黄金价,海影阁,市盈率如何计算
private void btnbutton_click(object sender, routedeventargs e)
{
messagebox.show("hello word");
}
private void modifyui()
{
// 模拟一些工作正在进行
thread.sleep(timespan.fromseconds(2));
//lblhello.content = "欢迎你光临wpf的世界,dispatcher";
this.dispatcher.invoke(dispatcherpriority.normal, (threadstart)delegate ()
{
lblhello.content = "欢迎你光临wpf的世界,dispatche 同步方法 !!"+datetime.now.tostring();
messagebox.show("你好我是多线程同步方法");
});
}
private void btnthd_click(object sender, routedeventargs e)
{
thread thread = new thread(modifyui);
thread.start();
}
/// <summary>
/// 异步方法
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnappbegininvoke_click(object sender, routedeventargs e)
{
new thread(() =>
{
application.current.dispatcher.begininvoke(dispatcherpriority.normal,
new action(() =>
{
thread.sleep(timespan.fromseconds(2));
this.lblhello.content = "欢迎你光临wpf的世界,dispatche 异步方法!!" + datetime.now.tostring();
messagebox.show("你好我是多线程异步方法");
}));
}).start();
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论