Skip to content

Commit a029068

Browse files
Updated to v2.1.0
1 parent aa8d07d commit a029068

15 files changed

+943
-829
lines changed

Src/AsyncAwaitBestPractices.MVVM.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata minClientVersion="2.5">
44
<id>AsyncAwaitBestPractices.MVVM</id>
5-
<version>2.1.0-pre1</version>
5+
<version>2.1.0</version>
66
<title>Task Extensions for MVVM</title>
77
<authors>Brandon Minnick, John Thiriet</authors>
88
<owners>Brandon Minnick</owners>
@@ -14,7 +14,7 @@
1414
<summary>Includes AsyncCommand and IAsyncCommand which allows ICommand to safely be used asynchronously with Task.</summary>
1515
<tags>task,fire and forget, threading, extensions, system.threading.tasks,async,await</tags>
1616
<dependencies>
17-
<dependency id="AsyncAwaitBestPractices" version="2.1.0-pre1" />
17+
<dependency id="AsyncAwaitBestPractices" version="2.1.0" />
1818
</dependencies>
1919
<releaseNotes>
2020
New In This Release:

Src/AsyncAwaitBestPractices.MVVM/AsyncCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public sealed class AsyncCommand : IAsyncCommand
9898
/// Initializes a new instance of the <see cref="T:TaskExtensions.MVVM.AsyncCommand`1"/> class.
9999
/// </summary>
100100
/// <param name="execute">The Function executed when Execute or ExecuteAysnc is called. This does not check canExecute before executing and will execute even if canExecute is false</param>
101-
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
102-
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
103101
/// <param name="canExecute">The Function that verifies whether or not AsyncCommand should execute.</param>
102+
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
103+
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
104104
public AsyncCommand(Func<Task> execute,
105105
Func<object, bool> canExecute = null,
106106
Action<Exception> onException = null,

Src/AsyncAwaitBestPractices.UnitTests/AsyncAwaitBestPractices.UnitTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
<ItemGroup>
1414
<ProjectReference Include="..\AsyncAwaitBestPractices.MVVM\AsyncAwaitBestPractices.MVVM.csproj" />
1515
</ItemGroup>
16+
<ItemGroup>
17+
<Folder Include="WeakEventManager\" />
18+
</ItemGroup>
1619
</Project>

Src/AsyncAwaitBestPractices.UnitTests/BaseTest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,27 @@ namespace AsyncAwaitBestPractices.UnitTests
55
{
66
public abstract class BaseTest
77
{
8+
#region Constant Fields
89
protected const int Delay = 500;
10+
protected readonly WeakEventManager _testWeakEventManager = new WeakEventManager();
11+
protected readonly WeakEventManager<string> _testStringWeakEventManager = new WeakEventManager<string>();
12+
#endregion
913

14+
#region Events
15+
protected event EventHandler TestEvent
16+
{
17+
add => _testWeakEventManager.AddEventHandler(value);
18+
remove => _testWeakEventManager.RemoveEventHandler(value);
19+
}
20+
21+
protected event EventHandler<string> TestStringEvent
22+
{
23+
add => _testStringWeakEventManager.AddEventHandler(value);
24+
remove => _testStringWeakEventManager.RemoveEventHandler(value);
25+
}
26+
#endregion
27+
28+
#region Methods
1029
protected Task NoParameterTask() => Task.Delay(Delay);
1130
protected Task IntParameterTask(int delay) => Task.Delay(delay);
1231
protected Task StringParameterTask(string text) => Task.Delay(Delay);
@@ -15,5 +34,6 @@ public abstract class BaseTest
1534

1635
protected bool CanExecuteTrue(object parameter) => true;
1736
protected bool CanExecuteFalse(object parameter) => false;
37+
#endregion
1838
}
1939
}

0 commit comments

Comments
 (0)