更新时间:2023-12-03 11:30:22
问题的根源在于包含IndexOf()方法的部分.它是在主线程上的始祖执行之前执行的,索引始终为-1.通过更改来解决:
The root of problem was the part that contains IndexOf() method. It was executing before the ancedent execution on Main Thread and index was always -1. Fixed by changing:
Device.BeginInvokeOnMainThread(() => ... );
作者
await Device.InvokeOnMainThreadAsync(() => { ... } );