Device.BeginInvokeOnMainThread(Action) Methode

Definition

Ruft einen Action-Delegaten im Hauptthread (der Benutzeroberfläche) des Geräts auf.

public static void BeginInvokeOnMainThread (Action action);
static member BeginInvokeOnMainThread : Action -> unit

Parameter

action
System.Action

Der aufzurufende Action-Delegat

Hinweise

In diesem Beispiel wird gezeigt, wie der Beschriftungstext im Standard Thread festgelegt wird, z. B. als Reaktion auf ein asynchrones Ereignis.

Device.BeginInvokeOnMainThread (() => {
  label.Text = "Async operation completed";
});

Gilt für: