private void ItemDataNeeded(object sender, VirtualListBoxItem item)
 {
     var warehouseListBoxItem = item as WarehouseListBoxItem;
     if (warehouseListBoxItem != null) {
         warehouseListBoxItem.ViewModel = _presenter.GetItem(item.Index);
     }
 }
 void ItemDataNeeded(object sender, VirtualListBoxItem item)
 {
     var orderListBoxItem = item as OrderListBoxItem;
     if (orderListBoxItem != null) {
         orderListBoxItem.ViewModel = _presenter.GetItem(item.Index);
     }
 }
 void ItemDataNeeded(object sender, VirtualListBoxItem item)
 {
     var priceListListBoxItem = item as PriceListListBoxItem;
     if (priceListListBoxItem != null)
     {
         priceListListBoxItem.ViewModel =_presenter.GetItem(item.Index);
     }
 }
 void ItemDataNeeded(object sender, VirtualListBoxItem item)
 {
     var shippingAddressListBoxItem = item as ShippingAddressListBoxItem;
     if (shippingAddressListBoxItem != null)
     {
         shippingAddressListBoxItem.ViewModel = _presenter.GetItem(item.Index);
     }
 }
 void ItemSelected(object sender, VirtualListBoxItem item)
 {
     _presenter.Select(item.Index);
 }
Esempio n. 6
0
 private void ItemSelected(object sender, VirtualListBoxItem item)
 {
     _routePresenter.Select(item.Index);
     _selectedListItem = item;
 }
Esempio n. 7
0
 private void ItemDataNeeded(object sender, VirtualListBoxItem item)
 {
     var pointListBoxItem = item as RoutePointListBoxItem;
     if (pointListBoxItem != null) {
         pointListBoxItem.ViewModel = _routePresenter.GetItem(item.Index);
     }
 }
Esempio n. 8
0
        protected virtual void AddListBoxItem(VirtualListBoxItem item)
        {
            if (_items.Any()) {
                var lastListBoxItem = _items.Last();
                item.Top = lastListBoxItem.Top + lastListBoxItem.Height;
            }
            else {
                item.Top = 0;
            }

            item.Left = 0;
            item.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
            item.DataNeeded += OnItemDataNeededHandler;
            item.Selected += OnItemSelectedHandler;

            _dataPanel.Controls.Add(item);
            _items.Add(item);
        }
Esempio n. 9
0
        void OnItemSelectedHandler(VirtualListBoxItem sender)
        {
            // return if listbox doesn't contains data
            if (sender.Index >= _itemCount)
                return;

            foreach (var item in _items)
            {
                if (item.IsSelected)
                {
                    item.IsSelected = false;
                }
            }

            SelectedIndex = sender.Index;
            sender.IsSelected = true;

            if (ItemSelected != null)
                ItemSelected.Invoke(this, sender);
        }
Esempio n. 10
0
 void OnItemDataNeededHandler(VirtualListBoxItem sender)
 {
     if (ItemDataNeeded != null && sender.Index < _itemCount)
         ItemDataNeeded.Invoke(this, sender);
 }
Esempio n. 11
0
 private void FilterClick(object sender)
 {
     _presenter.ChangeCategoryFilter();
     _selectedItem = null;
     _productPriceListBox.SetListSize(_presenter.InitializeListSize());
 }
Esempio n. 12
0
 private void ClearSearchClick(object sender)
 {
     _presenter.ClearSearch();
     _selectedItem = null;
     _productPriceListBox.SetListSize(_presenter.InitializeListSize());
 }
Esempio n. 13
0
 private void SearchClick(object sender, string criteria)
 {
     _presenter.Search(criteria);
     _selectedItem = null;
     _productPriceListBox.SetListSize(_presenter.InitializeListSize());
 }
Esempio n. 14
0
 private void ItemSelected(object sender, VirtualListBoxItem item)
 {
     _selectedItem = item;
     _presenter.Select(item.Index);
     _productPickUpExtraPanel.SetUnitsOfMeasures(_presenter.GetProductsUntisOfMeasure());
     _productPickUpExtraPanel.SetSelectedUnitOfMeasure(_presenter.SelectedModel.UnitOfMeasureId);
 }