Skip to content

Commit 1e48ff0

Browse files
committed
Add a method for testing activation
1 parent 5618a7a commit 1e48ff0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ReactiveUI/Activation.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public static void WhenActivated(this ISupportsActivation This, Action<Action<ID
5757
});
5858
}
5959

60+
public static IDisposable WithActivation(this ISupportsActivation This)
61+
{
62+
This.Activator.Activate();
63+
return Disposable.Create(This.Activator.Deactivate);
64+
}
65+
6066
public static IDisposable WhenActivated(this IViewFor This, Func<IEnumerable<IDisposable>> block)
6167
{
6268
var activationFetcher = activationFetcherCache.Get(This.GetType());

0 commit comments

Comments
 (0)