private void AddToSelected(MenuItem item) { if (!this.CurrentlySelectedMenuItems.Contains(item)) { this.CurrentlySelectedMenuItems.Add(item); } }
private void btnAddToOrder_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { if (this.lstMenu.SelectedItem != null) { var selItem = this.lstMenu.SelectedItem; bool selExist = false; foreach (var selCur in lstCSelItems.Items) { if (selItem.Equals(selCur)) { selExist = true; break; } } if (!selExist) { toSendItem = (MenuItem)selItem; var viewModel = (OrderViewModel)DataContext; if ((viewModel != null) && (viewModel.AddMenuItemCommand.CanExecute(null))) { viewModel.AddMenuItemCommand.Execute(toSendItem); } } } }
private void SubmitOrder(MenuItem ignore) { var order = new Order(); var items = new List<MenuItem>(); foreach (var item in CurrentlySelectedMenuItems) { items.Add(item); }; order.Items = items; Repository.Orders.Add(order); CurrentlySelectedMenuItems.Clear(); }
private void AddOrderItem(MenuItem obj) { _currentlySelectedMenuItems.Add(obj); }
private void AddItem(MenuItem currentItem) { this.CurrentlySelectedMenuItems.Add(currentItem); }
private void AddExecute(MenuItem item) { this.CurrentlySelectedMenuItems.Add(item); }
private void addMenuItem(MenuItem item) { CurrentlySelectedMenuItems.Add(item); NotifyPropertyChanged("CurrentlySelectedMenuItems"); }
private void AddMenuItem(MenuItem item) { CurrentlySelectedMenuItems.Add(item); }
private void AddMenuItem(MenuItem parameter) { this.CurrentlySelectedMenuItems.Add(parameter); }
private void AddMenuItemAction(MenuItem menuItem) { if (this.currentlySelectedMenuItems == null) this.currentlySelectedMenuItems = new ObservableCollection<MenuItem>(); this.currentlySelectedMenuItems.Add(menuItem); }
private void AddToOrder(MenuItem menuItem) { CurrentlySelectedMenuItems.Add(menuItem); SubmitOrderCommand.RaiseCanExecuteChanged(); }
public OrderViewModel(MenuItem addItem) { _addItem = addItem; AddMenuItemCommand = new DelegateCommand(AddMenuItem); SubmitOrderCommand = new DelegateCommand(SaveOrder); }