我有一个客户名单。第一次与所有客户一起呈现,然后我添加了一个过滤器,仅列出新客户。使用新客户修改了源项目。但它没有在视图中呈现。使用新的数组集调用适配器构造函数。但它没有调用方法public override int ItemCount。此页面将在屏幕锁定和设备解锁时呈现。请帮帮我
public class RecyclerViewRenderer : ViewRenderer<RecyclerViewList, RecyclerView>
{
.........
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if (e.PropertyName == RecyclerViewList.ItemsProperty.PropertyName)
{
var items = (Element as RecyclerViewList).Items;
if (items != null)
{
adapter = new RecyclerViewAdapter(items);
adapter.ItemClickEvent += OnItemClick;
adapter.PopUpClickEvent += OnPopUpClick;
recyclerViewCustomers.SetAdapter(adapter);
adapter.NotifyDataSetChanged();
// Task.Delay(500);
}
}
}
......
}