Label does not get updated [Resolved]

Posted by Vuyiswamb under WPF on 1/7/2016 | Points: 10 | Views : 1974 | Status : [Member] [MVP] [Administrator] | Replies : 2
Good Day

i have a code which is fired on the Button click even
 //Part 1 -- its not Getting updated 
Status.Background = new SolidColorBrush(Colors.Orange);
Status.Content = "Exporting, please wait...";

//Part 2 is working
Logger.ExportLogToExcel();

//Part 3 is Working

Status.Background = new SolidColorBrush(Colors.Yellow);
Status.Content = "Exported to Excel Successfully";

What is Part 1 not working. Basically , i am Exporting to Excel , and i am changing the Label that shows the status, i am changing the color and also the contents. but the Dont change i only see "Exported to Excel Successfully"

I thought might be that the Export is quick to a point that it immediately jump to Success message. i added a thread to make to sleep for a few seconds before it can export so i see a different background.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Rajnilari2015 on: 1/7/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Vuyiswamb Sir,

Could you please let us know what happens after this

if(Status.Content == "Exporting, please wait..."){


//Part 2 is working
Logger.ExportLogToExcel();

//Part 3 is Working

Status.Background = new SolidColorBrush(Colors.Yellow);
Status.Content = "Exported to Excel Successfully";
}


Thanks

--
Thanks & Regards,
RNA Team

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshatkiit on: 1/8/2016 [Member] Starter | Points: 25

Up
0
Down
Increase the sleep delay it will update.

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response