Skip to content

Commit 5a524b0

Browse files
committed
Allow view to be notified
This is in relation to #593. I agree with the issue but is a pretty big breaking change. This should allow the correct sequence of activation, activated callbacks.
1 parent 9c67073 commit 5a524b0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Caliburn.Micro.Core/Screen.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ async Task IActivate.ActivateAsync(CancellationToken cancellationToken)
109109
Log.Info("Activating {0}.", this);
110110
await OnActivateAsync(cancellationToken);
111111
IsActive = true;
112+
await OnActivatedAsync(cancellationToken);
112113

113114
await (Activated?.InvokeAllAsync(this, new ActivationEventArgs
114115
{
@@ -185,6 +186,15 @@ protected virtual Task OnActivateAsync(CancellationToken cancellationToken)
185186
return Task.FromResult(true);
186187
}
187188

189+
190+
/// <summary>
191+
/// Called when view has been activated.
192+
/// </summary>
193+
protected virtual Task OnActivatedAsync(CancellationToken cancellationToken)
194+
{
195+
return Task.FromResult(true);
196+
}
197+
188198
/// <summary>
189199
/// Called when deactivating.
190200
/// </summary>

0 commit comments

Comments
 (0)