diff --git a/src/GM.WPF/GM.WPF.Test/GM.WPF.Test.csproj b/src/GM.WPF/GM.WPF.Test/GM.WPF.Test.csproj index 16e8357..f0b5e11 100644 --- a/src/GM.WPF/GM.WPF.Test/GM.WPF.Test.csproj +++ b/src/GM.WPF/GM.WPF.Test/GM.WPF.Test.csproj @@ -36,28 +36,28 @@ 4 - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll + + ..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.dll - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Extras.dll + + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Platform.dll ..\packages\GM.Utility.1.2.1\lib\netstandard2.0\GM.Utility.dll - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - - - ..\packages\PropertyChanged.Fody.2.2.5\lib\net452\PropertyChanged.dll + + ..\packages\PropertyChanged.Fody.2.2.6\lib\net452\PropertyChanged.dll - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll + ..\packages\MvvmLightLibs.5.4.1\lib\net45\System.Windows.Interactivity.dll @@ -131,11 +131,11 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/GM.WPF/GM.WPF.Test/packages.config b/src/GM.WPF/GM.WPF.Test/packages.config index 1176836..0c5b073 100644 --- a/src/GM.WPF/GM.WPF.Test/packages.config +++ b/src/GM.WPF/GM.WPF.Test/packages.config @@ -27,9 +27,9 @@ Created: 2017-11-26 Author: Grega Mohorko --> - - + + - - + + \ No newline at end of file diff --git a/src/GM.WPF/GM.WPF/Controls/Dialogs/TaskDialog.cs b/src/GM.WPF/GM.WPF/Controls/Dialogs/TaskDialog.cs index 69fffb0..a723e97 100644 --- a/src/GM.WPF/GM.WPF/Controls/Dialogs/TaskDialog.cs +++ b/src/GM.WPF/GM.WPF/Controls/Dialogs/TaskDialog.cs @@ -47,25 +47,19 @@ public class TaskDialog:Dialog /// Determines whether the dialog was supposedly cancelled. /// protected bool WasCancelled { get; private set; } - - private AutoResetEvent endNotifier; + + private TaskCompletionSource dialogAwaiter; /// /// Shows the dialog and then waits until the is called. /// - protected async Task WaitDialog() + protected Task WaitDialog() { WasCancelled = false; - endNotifier = new AutoResetEvent(false); Show(); this.MoveFocusNext(); - await Task.Run(delegate - { - endNotifier.WaitOne(); - }); - - endNotifier?.Dispose(); - endNotifier = null; + dialogAwaiter = new TaskCompletionSource(); + return dialogAwaiter.Task; } /// @@ -75,7 +69,7 @@ await Task.Run(delegate protected void EndDialog(bool wasCancelled=false) { WasCancelled = wasCancelled; - endNotifier?.Set(); + dialogAwaiter.SetResult(null); } } } diff --git a/src/GM.WPF/GM.WPF/GM.WPF.csproj b/src/GM.WPF/GM.WPF/GM.WPF.csproj index 99f5c73..3c8b325 100644 --- a/src/GM.WPF/GM.WPF/GM.WPF.csproj +++ b/src/GM.WPF/GM.WPF/GM.WPF.csproj @@ -40,37 +40,31 @@ GM.StrongNameKey.snk - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll - False + + ..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll - False + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.dll - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll - False + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Extras.dll + + + ..\packages\MvvmLightLibs.5.4.1\lib\net45\GalaSoft.MvvmLight.Platform.dll ..\packages\GM.Utility.1.2.1\lib\netstandard2.0\GM.Utility.dll False - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - False - - - ..\packages\PropertyChanged.Fody.2.2.5\lib\net452\PropertyChanged.dll - False + + ..\packages\PropertyChanged.Fody.2.2.6\lib\net452\PropertyChanged.dll - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll - False + ..\packages\MvvmLightLibs.5.4.1\lib\net45\System.Windows.Interactivity.dll @@ -189,11 +183,11 @@ - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/src/GM.WPF/GM.WPF/GM.WPF.nuspec b/src/GM.WPF/GM.WPF/GM.WPF.nuspec index 05d57ab..c296764 100644 --- a/src/GM.WPF/GM.WPF/GM.WPF.nuspec +++ b/src/GM.WPF/GM.WPF/GM.WPF.nuspec @@ -11,7 +11,7 @@ https://mohorko.info/favicon.ico false $description$ - $description$ + Improved the behavior of TaskDialog. $copyright$ WPF MVVM controls utility extensions dialogs converters behaviors windows diff --git a/src/GM.WPF/GM.WPF/Properties/AssemblyInfo.cs b/src/GM.WPF/GM.WPF/Properties/AssemblyInfo.cs index 23a2ae7..a1ccb0d 100644 --- a/src/GM.WPF/GM.WPF/Properties/AssemblyInfo.cs +++ b/src/GM.WPF/GM.WPF/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.1.0")] -[assembly: AssemblyFileVersion("1.0.1.0")] +[assembly: AssemblyVersion("1.0.1.1")] +[assembly: AssemblyFileVersion("1.0.1.1")] diff --git a/src/GM.WPF/GM.WPF/packages.config b/src/GM.WPF/GM.WPF/packages.config index db633ad..f07b8c7 100644 --- a/src/GM.WPF/GM.WPF/packages.config +++ b/src/GM.WPF/GM.WPF/packages.config @@ -27,9 +27,9 @@ Created: 2017-10-29 Author: Grega Mohorko --> - - + + - - + + \ No newline at end of file