How to update label values in ViewController.cs file

I have implemented a Timer class in the viewcontroller.cs. My timer is working as i can print the incremental values in Console. However if I am trying to show the same value in a label using mylabel.StringValue=counter; .....it's not updating the label value?

Best Answer

Answers

  • codergcoderg Member

    added the following code in ViewControlller.cs

    InvokeOnMainThread(() =>
    {
    myLabelOutlet.StringValue = c.ToString();
    });

Sign In or Register to comment.