• 大小: 63KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: C#
  • 标签: C#  Thread  Timer  DoEvents  线程  

资源简介

Demo测试跨线更新UI 第一种 : Thread 达到跨线程更新UI 虽然使用Dispatcher.Invoke 和模拟winform 里面的DoEvent 但是运行中关闭还是会有异常,而且耗资源高; 第二种 : DispatcherTimer 失败:UI还是会卡顿; 第三种 : Timer 建议使用、资源占用少,关闭启动自如。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfApplication1
{
    /// 
    /// App.xaml 的交互逻辑
    /// 

    public partial class App : Application
    {
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        187  2014-07-25 21:35  WpfApplication1\WpfApplication1\App.config

     文件        326  2014-07-25 21:35  WpfApplication1\WpfApplication1\App.xaml

     文件        342  2014-07-25 21:35  WpfApplication1\WpfApplication1\App.xaml.cs

     文件      12800  2014-07-25 22:21  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.exe

     文件        187  2014-07-25 21:35  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.exe.config

     文件      44544  2014-07-25 22:21  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.pdb

     文件      22984  2014-07-25 22:17  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.vshost.exe

     文件        187  2014-07-25 21:35  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.vshost.exe.config

     文件        490  2010-03-18 12:39  WpfApplication1\WpfApplication1\bin\Debug\WpfApplication1.vshost.exe.manifest

     文件        899  2014-07-25 21:49  WpfApplication1\WpfApplication1\DispatcherHelper.cs

     文件        522  2014-07-25 22:17  WpfApplication1\WpfApplication1\MainWindow.xaml

     文件       3257  2014-07-25 22:21  WpfApplication1\WpfApplication1\MainWindow.xaml.cs

     文件       2325  2014-07-25 21:38  WpfApplication1\WpfApplication1\obj\Debug\App.g.cs

     文件       2325  2014-07-25 21:38  WpfApplication1\WpfApplication1\obj\Debug\App.g.i.cs

     文件       7196  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        933  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\MainWindow.baml

     文件       4087  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\MainWindow.g.cs

     文件       4087  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\MainWindow.g.i.cs

     文件          0  2014-07-25 21:35  WpfApplication1\WpfApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2014-07-25 21:35  WpfApplication1\WpfApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2014-07-25 21:35  WpfApplication1\WpfApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        694  2014-07-25 22:10  WpfApplication1\WpfApplication1\obj\Debug\Window1.baml

     文件       3009  2014-07-25 22:10  WpfApplication1\WpfApplication1\obj\Debug\Window1.g.cs

     文件       3009  2014-07-25 22:10  WpfApplication1\WpfApplication1\obj\Debug\Window1.g.i.cs

     文件       1644  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.csproj.FileListAbsolute.txt

     文件        917  2014-07-25 21:38  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.csproj.GenerateResource.Cache

     文件       2352  2014-07-25 21:38  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.csprojResolveAssemblyReference.cache

     文件      12800  2014-07-25 22:21  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.exe

     文件       1897  2014-07-25 22:17  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.g.resources

     文件      44544  2014-07-25 22:21  WpfApplication1\WpfApplication1\obj\Debug\WpfApplication1.pdb

............此处省略24个文件信息

评论

共有 条评论