Using events inside Status #306
Answered
by
phil-scott-78
ThomasArdal
asked this question in
Q&A
-
I'm wondering if it is possible to use events inside the AnsiConsole.Status()
.Start("Thinking...", ctx =>
{
// Simulate some work
AnsiConsole.MarkupLine("Doing some work...");
}); And I want to subscribe to an event inside the callback: var someObjectContainingEvents = ...
AnsiConsole.Status()
.Start("Thinking...", ctx =>
{
// Simulate some work
AnsiConsole.MarkupLine("Doing some work...");
someObjectContainingEvent.MyEvent += (sender, e) =>
{
ctx.MarkupLine("Doing some more work...");
}
}); This won't work because the |
Beta Was this translation helpful? Give feedback.
Answered by
phil-scott-78
Mar 16, 2021
Replies: 1 comment 12 replies
-
Certainly supported. But you'll need to do all your work in the action passed into the start method. If you move the |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
ThomasArdal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Certainly supported. But you'll need to do all your work in the action passed into the start method. If you move the
someObjectContainingEvents
in there things should wire up.