Data binding 如何在Xamarin.iOS中实时更新ViewController字段

Data binding 如何在Xamarin.iOS中实时更新ViewController字段,data-binding,timer,xamarin.ios,real-time,viewcontroller,Data Binding,Timer,Xamarin.ios,Real Time,Viewcontroller,我需要每100毫秒更新ViewController中的字段。 我尝试在主应用程序中设置计时器,但它要求ViewController中的屏幕更新例程是静态的。当它被设置为静态时,它无法引用单个字段。 当我尝试在ViewController中设置计时器时,出现异常: UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked fro

我需要每100毫秒更新ViewController中的字段。 我尝试在主应用程序中设置计时器,但它要求ViewController中的屏幕更新例程是静态的。当它被设置为静态时,它无法引用单个字段。 当我尝试在ViewController中设置计时器时,出现异常:

UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
更新屏幕的正确方法是什么?我不想刷新整个屏幕,只需要更新屏幕的某些元素

有没有办法在Xamarin.iOS中实现数据绑定?(我知道它以Xamarin.forms的形式提供,但我们不使用它。)

使用

InvokeOnMainThread ( () => {
    // manipulate UI controls
});