Hey Guys,
i have one difficult problem:
In my programm i set a Timer, which should read out all 1.5 seconds the last Error-Code from a List and shows it in a UITextView.
The function to search after the last element of the List works, it is shown via Console.Writeline (Works!!!).
But it won't be displayed in the UITextView... Can you help me whats the Problem?
Code for TimerElapsedEvent:
private void OnTimedEvent(Object source, ElapsedEventArgs e)
{
Console.WriteLine("[Interface]Timer: Error: " + ErrorCodes.GetLastError()); //<--This works and displays the last Error
UITextView1.Text = ErrorCodes.GetLastError(); //<-- This dont work, function returns variable<string>
}
Use InvokeOnMainThread
, it should be able to work ,refer https://stackoverflow.com/a/25619594/8187800
Answers
Try to use
Device.BeginInvokeOnMainThread
to wrap the UI-related execution .Mmh no, it's still don't work..
Use
InvokeOnMainThread
, it should be able to work ,refer https://stackoverflow.com/a/25619594/8187800