protected void CheckEmpty (bool animate) { if (order.Products.Count == 0) { this.View.AddSubview (EmptyCartImageView = new EmptyBasketView () { Alpha = animate ? 0f : 1f, }); this.View.BringSubviewToFront (EmptyCartImageView); if (animate) UIView.Animate (.25, () => EmptyCartImageView.Alpha = 1f); return; } if (EmptyCartImageView == null) return; EmptyCartImageView.RemoveFromSuperview (); EmptyCartImageView = null; }
protected void CheckEmpty(bool animate) { if (order.Products.Count == 0) { this.View.AddSubview(EmptyCartImageView = new EmptyBasketView() { Alpha = animate ? 0f : 1f, }); this.View.BringSubviewToFront(EmptyCartImageView); if (animate) { UIView.Animate(.25, () => EmptyCartImageView.Alpha = 1f); } return; } if (EmptyCartImageView == null) { return; } EmptyCartImageView.RemoveFromSuperview(); EmptyCartImageView = null; }