wpf 多个窗口的显示与隐藏
2015-08-19 22:41
471 查看
[code] //新建一个lamda的用来开启前台Ui线程,显示gif动画,并置顶 this.Dispatcher.Invoke(new Action(() => { GlobalHelper._mainWindow.grid_prograssbar.Visibility = Visibility.Visible; System.Windows.Controls.Panel.SetZIndex(GlobalHelper._mainWindow.grid_prograssbar, 10000 * 1000); })); //检测gif动画线程是否开启,如果之前存在,关闭,并释放资源 if (this._threadGif != null) { this._threadGif.Abort(); this._threadGif = null; } //新建一个lambda表达示:用来不停的检测切换函数是否执行完毕,如果执行完毕就关闭gif动画,并线程的资源和把标志量还原为false this._threadGif = new Thread(() => { while (true) { if (this._bIsOverofPanelAnaly == true) { this.Dispatcher.Invoke(new Action(() => { GlobalHelper._mainWindow.grid_prograssbar.Visibility = Visibility.Hidden; })); this._bIsOverofPanelAnaly = false; this._threadPanelAnaly.Abort(); this._threadPanelAnaly = null; this._threadGif.Abort(); this._threadGif = null; } } }); //开启gif显示线程 this._threadGif.Start(); //开启切换方法函数的线程 if (this._threadPanelAnaly != null) { this._threadPanelAnaly.Abort(); this._threadPanelAnaly = null; } this._threadPanelAnaly = new Thread(BigPanelAnaly); this._threadPanelAnaly.Start();
相关文章推荐
- onTextChanged参数解释及实现EditText字数监听
- C++11 第二章
- 深入学习Android异步任务-AsyncTask
- android App性能优化技巧浅谈
- 什么是IP地址、子网掩码、路由和网关
- Shell脚本Demo
- maven学习
- H3CNE 直连路由和静态路由
- 二叉排序树研究
- ADB server didn't ACK
- 【LeetCode】191_Number of 1 Bits
- XX宝面试题——css部分
- 毕业六年IT总结之二
- 定时器&(对话框)
- 【一些事晚报】老板的需求「不靠谱」,怎么办
- HR筛选简历的真相!(据说是来自某公司内部,被外传哦)
- Android学习笔记(十三)
- 更换SSD卡后卡顿问题解决方式
- Hibernate--快速上手
- XX宝面试题——JS部分