├── .gitignore ├── Animation ├── Animation.csproj ├── App.xaml ├── App.xaml.cs ├── Properties │ ├── Annotations.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── TransitionShaking.xaml └── TransitionShaking.xaml.cs ├── BitmapCache ├── App.xaml ├── App.xaml.cs ├── BitmapCache.csproj ├── BitmapCache.gif ├── MainWindow.xaml ├── MainWindow.xaml.cs └── README.md ├── CanNotReceiveTouchMessageWS_EX_TRANSPARENT ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── CanNotReceiveTouchMessageWS_EX_TRANSPARENT.csproj ├── CanNotReceiveTouchMessageWS_EX_TRANSPARENT.sln ├── MainWindow.xaml ├── MainWindow.xaml.cs └── README.md ├── ChildWindowDisplayedAndThenBackToMainWindow ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── ChildWindowDisplayedAndThenBackToMainWindow.csproj ├── ChildWindowDisplayedAndThenBackToMainWindow.sln ├── MainWindow.xaml ├── MainWindow.xaml.cs └── README.md ├── ChildWindows ├── App.xaml ├── App.xaml.cs ├── ChildWindows.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── README.md └── demo.mp4 ├── ImageMemoryLeak ├── App.xaml ├── App.xaml.cs ├── ImageMemoryLeak.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs └── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ImageMemoryLeakDotNetCore ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── ImageMemoryLeakDotNetCore.csproj ├── MainWindow.xaml └── MainWindow.xaml.cs ├── Issues.sln ├── MainThreadDeadlockWithStylusInputThread ├── MainThreadDeadlockWhenTouchThreadWaitForWindowClosed │ ├── MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.sln │ └── MainThreadDeadlockWhenTouchThreadWaitForWindowClosed │ │ ├── App.config │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.csproj │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ └── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings └── README.md ├── MouseLeaveEvent ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── MouseLeaveEvent.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── README.md ├── Window1.xaml └── Window1.xaml.cs ├── MultiDragDemo ├── MultiDragDemo.sln └── MultiDragDemo │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── MultiDragDemo.csproj │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ └── demo.mp4 ├── README.md ├── RenderTargetBitmapThrowsCOMExceptionWhenCreatedTooFast ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings └── RenderTargetBitmapThrowsCOMExceptionWhenCreatedTooFast.csproj └── WPFAppsCrashIfDisplayTextWithTooManyCombiningMarks ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings └── WPFAppsCrashIfDisplayTextWithTooManyCombiningMarks.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | 24 | # Visual Studio 2015 cache/options directory 25 | .vs/ 26 | # Uncomment if you have tasks that create the project's static files in wwwroot 27 | #wwwroot/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | # NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | # DNX 43 | project.lock.json 44 | artifacts/ 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opendb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | # NuGet v3's project.json files produces more ignoreable files 154 | *.nuget.props 155 | *.nuget.targets 156 | 157 | # Microsoft Azure Build Output 158 | csx/ 159 | *.build.csdef 160 | 161 | # Microsoft Azure Emulator 162 | ecf/ 163 | rcf/ 164 | 165 | # Microsoft Azure ApplicationInsights config file 166 | ApplicationInsights.config 167 | 168 | # Windows Store app package directory 169 | AppPackages/ 170 | BundleArtifacts/ 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # RIA/Silverlight projects 190 | Generated_Code/ 191 | 192 | # Backup & report files from converting an old project file 193 | # to a newer Visual Studio version. Backup files are not needed, 194 | # because we have git ;-) 195 | _UpgradeReport_Files/ 196 | Backup*/ 197 | UpgradeLog*.XML 198 | UpgradeLog*.htm 199 | 200 | # SQL Server files 201 | *.mdf 202 | *.ldf 203 | 204 | # Business Intelligence projects 205 | *.rdl.data 206 | *.bim.layout 207 | *.bim_*.settings 208 | 209 | # Microsoft Fakes 210 | FakesAssemblies/ 211 | 212 | # GhostDoc plugin setting file 213 | *.GhostDoc.xml 214 | 215 | # Node.js Tools for Visual Studio 216 | .ntvs_analysis.dat 217 | 218 | # Visual Studio 6 build log 219 | *.plg 220 | 221 | # Visual Studio 6 workspace options file 222 | *.opt 223 | 224 | # Visual Studio LightSwitch build output 225 | **/*.HTMLClient/GeneratedArtifacts 226 | **/*.DesktopClient/GeneratedArtifacts 227 | **/*.DesktopClient/ModelManifest.xml 228 | **/*.Server/GeneratedArtifacts 229 | **/*.Server/ModelManifest.xml 230 | _Pvt_Extensions 231 | 232 | # Paket dependency manager 233 | .paket/paket.exe 234 | 235 | # FAKE - F# Make 236 | .fake/ 237 | -------------------------------------------------------------------------------- /Animation/Animation.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EA13FC10-8BD3-4D0B-ADE2-922A22753F08} 8 | WinExe 9 | Properties 10 | WpfBugDemo 11 | WpfBugDemo 12 | v4.6.2 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | false 28 | 29 | 30 | AnyCPU 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | false 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 4.0 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | MSBuild:Compile 59 | Designer 60 | 61 | 62 | MSBuild:Compile 63 | Designer 64 | 65 | 66 | App.xaml 67 | Code 68 | 69 | 70 | 71 | TransitionShaking.xaml 72 | Code 73 | 74 | 75 | 76 | 77 | Code 78 | 79 | 80 | True 81 | True 82 | Resources.resx 83 | 84 | 85 | True 86 | Settings.settings 87 | True 88 | 89 | 90 | ResXFileCodeGenerator 91 | Resources.Designer.cs 92 | 93 | 94 | SettingsSingleFileGenerator 95 | Settings.Designer.cs 96 | 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /Animation/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | -------------------------------------------------------------------------------- /Animation/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace WpfBugDemo 2 | { 3 | /// 4 | /// Interaction logic for App.xaml 5 | /// 6 | public partial class App 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /Animation/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("WpfBugDemo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("WpfBugDemo")] 15 | [assembly: AssemblyCopyright("Copyright © 2016")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Animation/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WpfBugDemo.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfBugDemo.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Animation/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Animation/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WpfBugDemo.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Animation/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Animation/TransitionShaking.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | Click the button below, you can see a transition animation. 21 | However, the blue block will shakes slightly. 22 | If you can't see the shaking problem , please resize or move the window and try again. 23 | Maybe it's caused by the non-integral rendering size, but how can we avoid this problem for the particular layout? 24 | 25 | 26 | 27 | 28 | 29 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ImageMemoryLeak/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Media; 7 | using System.Windows.Media.Imaging; 8 | 9 | namespace ImageMemoryLeak 10 | { 11 | /// 12 | /// MainWindow.xaml 的交互逻辑 13 | /// 14 | public partial class MainWindow 15 | { 16 | public MainWindow() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void Button_Click(object sender, RoutedEventArgs e) 22 | { 23 | // 每次点击此按钮会将当前呈现的图片移除视觉树,再将其Source属性设置为null。 24 | // 然后新建一个Image控件,并将其Source属性设置为RenderTargetBitmap对象,再呈现出来。 25 | // 再次过程中,RenderTargetBitmap对象从来不会被回收,造成内存泄露。 26 | // 可以从资源管理其中观察到程序的内存持续上涨的现象。 27 | 28 | // Remove the current Image control from the visual tree and set source is null when click button. 29 | // Then new a image control and add source to the RenderTargetBitmap object and show it. 30 | // You can see the gc never delete the RenderTargetBitmap object that make memory leak. 31 | 32 | 33 | var oldBorder = RootGrid.Children.OfType().LastOrDefault(); 34 | if (oldBorder != null) 35 | { 36 | var oldImage = (Image)oldBorder.Child; 37 | 38 | 39 | // 如果在Image控件移除视觉树之前将其Source属性设为null,并调用UpdateLayout方法。 40 | // 则RenderTargetBitmap对象可被回收,不会导致内存泄露。 41 | // 取消注释下面的代码可以观察到上述现象。 42 | // In order to solve it , you should set the image.Source is null and use UpdateLayout. 43 | // The below code can solve it. 44 | // oldImage.Source = null; 45 | // oldImage.UpdateLayout(); 46 | 47 | // 将当前的Image控件移除视觉树。 48 | // Remove the current Image control from the visual tree. 49 | RootGrid.Children.Remove(oldBorder); 50 | oldImage.Source = null; 51 | Borders.Add(oldBorder); 52 | } 53 | 54 | var bitmap = new RenderTargetBitmap(1024, 1024, 96, 96, PixelFormats.Default); 55 | 56 | var image = new Image { Source = bitmap }; 57 | var border = new Border { Child = image }; 58 | RootGrid.Children.Add(border); 59 | 60 | // 为了便于观察内存的变化,每次操作后都会进行垃圾回收。 61 | // In order to facilitate changes in memory, after each operation will be garbage collection 62 | GC.Collect(); 63 | } 64 | 65 | public readonly List Borders = new List(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /ImageMemoryLeak/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的常规信息通过以下 8 | // 特性集控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("ImageMemoryLeak")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("ImageMemoryLeak")] 15 | [assembly: AssemblyCopyright("Copyright © 2015")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 使此程序集中的类型 20 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 21 | // 则将该类型上的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请在 25 | // 中的 .csproj 文件中 26 | //设置 CultureYouAreCodingWith。 例如,如果您在源文件中 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(在页面或应用程序资源词典中 37 | // 未找到某个资源的情况下使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(在页面、应用程序或任何主题特定资源词典中 40 | // 未找到某个资源的情况下使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下面四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 52 | // 方法是按如下所示使用“*”: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /ImageMemoryLeak/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.34014 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ImageMemoryLeak.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的、缓存的 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ImageMemoryLeak.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, 56 | /// 方法是使用此强类型资源类。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ImageMemoryLeak/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /ImageMemoryLeak/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34014 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ImageMemoryLeak.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ImageMemoryLeak/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace ImageMemoryLeakDotNetCore 4 | { 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly:ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] 11 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/ImageMemoryLeakDotNetCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | netcoreapp3.1 6 | true 7 | 8 | 9 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ImageMemoryLeakDotNetCore/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using System.Windows.Media; 7 | using System.Windows.Media.Imaging; 8 | 9 | namespace ImageMemoryLeakDotNetCore 10 | { 11 | public partial class MainWindow 12 | { 13 | public MainWindow() 14 | { 15 | InitializeComponent(); 16 | } 17 | 18 | private void Button_Click(object sender, RoutedEventArgs e) 19 | { 20 | // Remove the current Image control from the visual tree and set source is null when click button. 21 | // Then new a image control and add source to the RenderTargetBitmap object and show it. 22 | // You can see the gc never delete the RenderTargetBitmap object that make memory leak. 23 | 24 | 25 | var oldBorder = RootGrid.Children.OfType().LastOrDefault(); 26 | if (oldBorder != null) 27 | { 28 | var oldImage = (Image)oldBorder.Child; 29 | 30 | // In order to solve it , you should set the image.Source is null and use UpdateLayout. 31 | // The below code can solve it. 32 | // oldImage.Source = null; 33 | // oldImage.UpdateLayout(); 34 | 35 | // Remove the current Image control from the visual tree. 36 | RootGrid.Children.Remove(oldBorder); 37 | oldImage.Source = null; 38 | Borders.Add(oldBorder); 39 | } 40 | 41 | var bitmap = new RenderTargetBitmap(1024, 1024, 96, 96, PixelFormats.Default); 42 | 43 | var image = new Image { Source = bitmap }; 44 | var border = new Border { Child = image }; 45 | RootGrid.Children.Add(border); 46 | 47 | // In order to facilitate changes in memory, after each operation will be garbage collection 48 | GC.Collect(); 49 | } 50 | 51 | public readonly List Borders = new List(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Issues.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29418.71 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BitmapCache", "BitmapCache\BitmapCache.csproj", "{01005462-54D7-4537-8C4A-FF0525ACB82C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Animation", "Animation\Animation.csproj", "{EA13FC10-8BD3-4D0B-ADE2-922A22753F08}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChildWindows", "ChildWindows\ChildWindows.csproj", "{85164B73-270A-4DD0-9289-AD6D027AD17D}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiDragDemo", "MultiDragDemo\MultiDragDemo\MultiDragDemo.csproj", "{38B7E662-8730-414B-8B30-09E5622BFC0B}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MouseLeaveEvent", "MouseLeaveEvent\MouseLeaveEvent.csproj", "{5ED92DFA-883A-48A9-99E8-EC5BE33B92CE}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageMemoryLeak", "ImageMemoryLeak\ImageMemoryLeak.csproj", "{80780E88-2D90-452D-BFEC-E07C9555E063}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MainThreadDeadlockWhenTouchThreadWaitForWindowClosed", "MainThreadDeadlockWithStylusInputThread\MainThreadDeadlockWhenTouchThreadWaitForWindowClosed\MainThreadDeadlockWhenTouchThreadWaitForWindowClosed\MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.csproj", "{69AFA209-DAD3-45E4-A5AB-037B2111E9CA}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RenderTargetBitmapThrowsCOMExceptionWhenCreatedTooFast", "RenderTargetBitmapThrowsCOMExceptionWhenCreatedTooFast\RenderTargetBitmapThrowsCOMExceptionWhenCreatedTooFast.csproj", "{5B60183F-432E-467D-AA5C-BE85345260CA}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPFAppsCrashIfDisplayTextWithTooManyCombiningMarks", "WPFAppsCrashIfDisplayTextWithTooManyCombiningMarks\WPFAppsCrashIfDisplayTextWithTooManyCombiningMarks.csproj", "{BDAA628B-7236-45A0-8C88-80309A67D6DD}" 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {01005462-54D7-4537-8C4A-FF0525ACB82C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {01005462-54D7-4537-8C4A-FF0525ACB82C}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {01005462-54D7-4537-8C4A-FF0525ACB82C}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {01005462-54D7-4537-8C4A-FF0525ACB82C}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {EA13FC10-8BD3-4D0B-ADE2-922A22753F08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {EA13FC10-8BD3-4D0B-ADE2-922A22753F08}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {EA13FC10-8BD3-4D0B-ADE2-922A22753F08}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {EA13FC10-8BD3-4D0B-ADE2-922A22753F08}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {85164B73-270A-4DD0-9289-AD6D027AD17D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {85164B73-270A-4DD0-9289-AD6D027AD17D}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {85164B73-270A-4DD0-9289-AD6D027AD17D}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {85164B73-270A-4DD0-9289-AD6D027AD17D}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {38B7E662-8730-414B-8B30-09E5622BFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {38B7E662-8730-414B-8B30-09E5622BFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {38B7E662-8730-414B-8B30-09E5622BFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {38B7E662-8730-414B-8B30-09E5622BFC0B}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {5ED92DFA-883A-48A9-99E8-EC5BE33B92CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {5ED92DFA-883A-48A9-99E8-EC5BE33B92CE}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {5ED92DFA-883A-48A9-99E8-EC5BE33B92CE}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {5ED92DFA-883A-48A9-99E8-EC5BE33B92CE}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {80780E88-2D90-452D-BFEC-E07C9555E063}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {80780E88-2D90-452D-BFEC-E07C9555E063}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {80780E88-2D90-452D-BFEC-E07C9555E063}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {80780E88-2D90-452D-BFEC-E07C9555E063}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 55 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 56 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 57 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Release|Any CPU.Build.0 = Release|Any CPU 58 | {5B60183F-432E-467D-AA5C-BE85345260CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {5B60183F-432E-467D-AA5C-BE85345260CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {5B60183F-432E-467D-AA5C-BE85345260CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 61 | {5B60183F-432E-467D-AA5C-BE85345260CA}.Release|Any CPU.Build.0 = Release|Any CPU 62 | {BDAA628B-7236-45A0-8C88-80309A67D6DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {BDAA628B-7236-45A0-8C88-80309A67D6DD}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {BDAA628B-7236-45A0-8C88-80309A67D6DD}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {BDAA628B-7236-45A0-8C88-80309A67D6DD}.Release|Any CPU.Build.0 = Release|Any CPU 66 | EndGlobalSection 67 | GlobalSection(SolutionProperties) = preSolution 68 | HideSolutionNode = FALSE 69 | EndGlobalSection 70 | GlobalSection(ExtensibilityGlobals) = postSolution 71 | SolutionGuid = {6D66B8B4-6548-42C4-A967-857AD6737D1D} 72 | EndGlobalSection 73 | EndGlobal 74 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MainThreadDeadlockWhenTouchThreadWaitForWindowClosed", "MainThreadDeadlockWhenTouchThreadWaitForWindowClosed\MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.csproj", "{69AFA209-DAD3-45E4-A5AB-037B2111E9CA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DDA91E62-C46A-405F-A4B3-35D503E63E4C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace MainThreadDeadlockWhenTouchThreadWaitForWindowClosed 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {69AFA209-DAD3-45E4-A5AB-037B2111E9CA} 8 | WinExe 9 | MainThreadDeadlockWhenTouchThreadWaitForWindowClosed 10 | MainThreadDeadlockWhenTouchThreadWaitForWindowClosed 11 | v4.5 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 4.0 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | MSBuild:Compile 55 | 56 | 57 | MSBuild:Compile 58 | Designer 59 | 60 | 61 | App.xaml 62 | Code 63 | 64 | 65 | MainWindow.xaml 66 | Code 67 | 68 | 69 | 70 | 71 | Code 72 | 73 | 74 | True 75 | True 76 | Resources.resx 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | SettingsSingleFileGenerator 89 | Settings.Designer.cs 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /MainThreadDeadlockWithStylusInputThread/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainThreadDeadlockWhenTouchThreadWaitForWindowClosed/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 12 |