Skip to content

Commit

Permalink
Merge pull request #859 from erik-hooper/feature/AllowOnActivated
Browse files Browse the repository at this point in the history
Allow view to be notified
  • Loading branch information
vb2ae authored May 29, 2023
2 parents 9c67073 + 5a524b0 commit 145c480
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Caliburn.Micro.Core/Screen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ async Task IActivate.ActivateAsync(CancellationToken cancellationToken)
Log.Info("Activating {0}.", this);
await OnActivateAsync(cancellationToken);
IsActive = true;
await OnActivatedAsync(cancellationToken);

await (Activated?.InvokeAllAsync(this, new ActivationEventArgs
{
Expand Down Expand Up @@ -185,6 +186,15 @@ protected virtual Task OnActivateAsync(CancellationToken cancellationToken)
return Task.FromResult(true);
}


/// <summary>
/// Called when view has been activated.
/// </summary>
protected virtual Task OnActivatedAsync(CancellationToken cancellationToken)
{
return Task.FromResult(true);
}

/// <summary>
/// Called when deactivating.
/// </summary>
Expand Down

0 comments on commit 145c480

Please sign in to comment.