09 2011 档案

BeginInvoke更新界面 UI死掉 WPF
摘要: BeginInvoke更新界面 UI死掉异步socket的处理消息事件 void ProcessA_BBuff(byte[] GetBuffer, Client.ClientInfo clientTemp)中需要根据客户端发来的坐标信息 更新UI上对应usercontrol的位置(类似于GIS系统中小人在地图上更新位置) 当只把移动的少量代码(2行)写到BeginInvoke中时 就是说将BeginInvoke 写到ProcessA_BBuff这个事件里面 程序跑几分钟后UI就会死掉 this.Dispatcher.BeginInvoke((Action)delegate() { //移动..阅读全文

posted @ 2011-09-02 16:21 badnewfish 阅读(104) | 评论 (0) 编辑

未处理 System.Reflection.TargetInvocationException Message=调用的目标发生了异常。
摘要: 遇到次问题 多半是this.Dispatcher.BeginInvoke((Action)delegate(){})大括号中的代码出了异常 如里面访问的数组单元被外部线程清空等但是vs又捕捉不到 主程序会崩溃阅读全文

posted @ 2011-09-01 17:03 badnewfish 阅读(498) | 评论 (0) 编辑