Wpf-Show in progress label untill the operation finished
===

I have a button and a label on my UI. When i clicks on the button i want to show "In Progress" on the label until the for loop finished and then again the same label should show the result of the collection.


       private void button1_Click(object sender, RoutedEventArgs e)
        {
            label1.Content = "In progress..";          
            List<string> intList = new List<string>();
            for (long i = 0; i <= 50000000; i++)
            {
                intList.Add("Test");
            }
            label1.Content = intList.ToString();
        }