public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); ListView.DividerHeight = 0; ListView.Divider = null; ListAdapter = new GroceryListAdapter (view.Context, _order.Products); if (ListAdapter.Count == 0) checkoutButton.Visibility = ViewStates.Invisible; _order.ProductsChanged += (sender, e) => { checkoutButton.Visibility = _order.Products.Any () ? ViewStates.Visible : ViewStates.Invisible; }; }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); ListView.DividerHeight = 0; ListView.Divider = null; ListAdapter = new GroceryListAdapter(view.Context, _order.Products); if (ListAdapter.Count == 0) { checkoutButton.Visibility = ViewStates.Invisible; } _order.ProductsChanged += (sender, e) => { checkoutButton.Visibility = _order.Products.Any() ? ViewStates.Visible : ViewStates.Invisible; }; }