How do I pass 1 argument in lambda expression?

string tempTitle = "whatever";

await Task.Run(async (tempTitle) => // here I am having some errors, no idea how to pass this tempTitle variable inside this task to avoid cross-thread exception
{
    Text = "Complete!";
    await Task.Delay(5000);
    Text = tempTitle;
});
Maybe I need to put Action<string> somewhere? Hmm
image.png
Was this page helpful?