protected virtual void UpdateEmptyView() { if (ItemsViewAdapter == null) { return; } var emptyView = ItemsView?.EmptyView; var emptyViewTemplate = ItemsView?.EmptyViewTemplate; if (emptyView != null || emptyViewTemplate != null) { if (_emptyViewAdapter == null) { _emptyViewAdapter = new EmptyViewAdapter(); } _emptyViewAdapter.EmptyView = emptyView; _emptyViewAdapter.EmptyViewTemplate = emptyViewTemplate; Watch(ItemsViewAdapter); } else { Unwatch(ItemsViewAdapter); } UpdateEmptyViewVisibility(); }
protected virtual void UpdateEmptyView() { if (ItemsViewAdapter == null || ItemsView == null) { return; } var emptyView = ItemsView?.EmptyView; var emptyViewTemplate = ItemsView?.EmptyViewTemplate; if (emptyView != null || emptyViewTemplate != null) { if (_emptyViewAdapter == null) { _emptyViewAdapter = new EmptyViewAdapter(ItemsView); } _emptyViewAdapter.EmptyView = emptyView; _emptyViewAdapter.EmptyViewTemplate = emptyViewTemplate; _emptyCollectionObserver.Start(ItemsViewAdapter); } else { _emptyCollectionObserver.Stop(ItemsViewAdapter); } UpdateEmptyViewVisibility(); }
protected virtual void UpdateEmptyView() { if (ItemsViewAdapter == null || ItemsView == null) { return; } var emptyView = ItemsView?.EmptyView; var emptyViewTemplate = ItemsView?.EmptyViewTemplate; if (emptyView != null || emptyViewTemplate != null) { if (_emptyViewAdapter == null) { _emptyViewAdapter = new EmptyViewAdapter(ItemsView); } if (ItemsView is StructuredItemsView structuredItemsView) { _emptyViewAdapter.Header = structuredItemsView.Header; _emptyViewAdapter.HeaderTemplate = structuredItemsView.HeaderTemplate; _emptyViewAdapter.Footer = structuredItemsView.Footer; _emptyViewAdapter.FooterTemplate = structuredItemsView.FooterTemplate; } _emptyViewAdapter.EmptyView = emptyView; _emptyViewAdapter.EmptyViewTemplate = emptyViewTemplate; _emptyCollectionObserver.Start(ItemsViewAdapter); _emptyViewAdapter.NotifyDataSetChanged(); } else { _emptyCollectionObserver.Stop(ItemsViewAdapter); } UpdateEmptyViewVisibility(); }