I\'m trying to make a label display some text, and then after a short while refresh itself and be able to re-display something else later. At the moment however I don\'t know ho
Updated for async/await. This will
// Update all text with warning message
foreach (var x in mod)
{
labelWARNING.Visible = true;
labelWarningMessage.Text = "This module has a prerequisite module: " + x;
}
// Wait 1 second or 1000ms
await Task.Delay(1000);
// Now dismiss the message
foreach (var x in mod)
labelWarningMessage.Text = "";
The surrounding function needs to be an public async Task SomeMethod()
or
public async void buttonClick(object sender, RoutedEventArgs e)
to use the await
keyword