If you are in your own thread and the code looks similar to this:
//1. Code before your UI action
//2. Code that changes UI
//3. Code after your UI action
Than you need to do the following.
First you need to get the current instance of you main activity that you are in, this can be achieved like this:
In your MainActivity.cs you need to change the App loading to
// LoadApplication(new App(this));
In your "App" class you than write:
// public App(Object o)
and
// currentMainActivity = (Android.App.Activity)o;
After that you have everywhere in your code access to the current java main activity.
To do some UI actions in your threads, just use the following code:
//1. Code before your UI action
App.currentMainActivity.RunOnUiThread(() =>
{
// 2. Code that changes UI
});
//3. Code after your UI action