I am trying to implement a spinner in my wpf. If the data are being fetched the spinner should be shown but as soon as all data are fetched, then the spinner should be hidden. I know I have to use async and await for this to work but my code below doesn't work.

```
private async Task onGetFiles(object sender, RoutedEventArgs e)
{
    if (txtIpAddress.Text.Contains("IP Address"))
    {
        MessageBox.Show("Ip Address is invalid");
        return;
    } else if (string.IsNullOrEmpty(dpDate.Text))
    {
        MessageBox.Show("Date is invalid");
        return;
    }

    var date = dpDate.Text;
    var splitDate = date.Split('/');
    int month = Convert.ToInt32(splitDate[1]);
    int day = Convert.ToInt32(splitDate[0]);
    var year = splitDate[2];
    var filePath = $@"\\{txtIpAddress.Text}\i\Hardware Interfacing\{year}\{month}\{day}\PeripheralLogsDq.txt";

    using (new ImpersonateUser("username", "", "password"))
    {
        IsWaveActive = true;
        await Task.Run(() => LoadLogs(rbQueue, File.ReadAllText(filePath)));
        await Task.Run(() => LoadLogs(rbQueue, File.ReadAllText(filePath)));
        IsWaveActive = false;
    } 
}

private bool LoadLogs(RichTextBox rtb, string msg)
{
    try
    {
        FlowDocument flowDocument = new FlowDocument();
        Paragraph paragraph = new Paragraph();
        paragraph.Inlines.Add(new Run(msg));
        flowDocument.Blocks.Add(paragraph);
        rtb.Document = flowDocument;
        return true;
    }
    catch
    {
        return false;
    }

}

```

My error is 

```
Error   CS0407  'Task MainWindow.onGetFiles(object, RoutedEventArgs)' has the wrong return type MenuAnimation   C:\Users\Rodne\OneDrive\Desktop\AnimatedMenu1-master\MenuAnimation\MainWindow.xaml  188 Active

```

I get this error when I try to compile so I am not able to run it.