private int GetItemQuantityToAdd()
        {
            var addItemToShoppingListWindow = new AddShoppingListItemWindow();
            var addItemToShoppingListItemWindowViewModel = new AddShoppingListItemWindowViewModel(addItemToShoppingListWindow, SalesSearchResultSelectedItem.DisplayName, SalesSearchResultSelectedItem.InventoryModel.Quantity);

            addItemToShoppingListWindow.ShowDialog();

            return(addItemToShoppingListItemWindowViewModel.Quantity);
        }
Пример #2
0
        public AddShoppingListItemWindowViewModel(AddShoppingListItemWindow window, string itemName, int unitsInStock)
        {
            window.DataContext = this;
            _window            = window;
            ItemName           = itemName;
            MaximumQuantity    = unitsInStock;

            ConfirmCommand = new DelegateCommand(ExecuteConfirmCommand);
        }