public void RemoveOrderedItem(MenuOptionItemModel menuOptionItem) { var orderedItem = OrderedItems.FirstOrDefault(i => i.MenuOption.Equals(menuOptionItem)); if (orderedItem != null) { OrderedItems.Remove(orderedItem); ItemsCountChanged?.Invoke(this, EventArgs.Empty); } }
public void OnMenuOptionCheckedChanged(MenuOptionItemModel menuOption) { if (menuOption.State.HasFlag(ListItemState.Selected)) { menuOption.RemoveState(ListItemState.Selected); _yourOrderModel.RemoveOrderedItem(menuOption); } else { menuOption.AddState(ListItemState.Selected); _yourOrderModel.AddOrderedItem(menuOption); } }
public void AddOrderedItem(MenuOptionItemModel menuOptionItem) { OrderedItems.Add(new OrderedItemModel(menuOptionItem)); ItemsCountChanged?.Invoke(this, EventArgs.Empty); }