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); }
private void ItemSelected(object sender, VirtualListBoxItem item) { _routePresenter.Select(item.Index); _selectedListItem = item; }
private void ItemDataNeeded(object sender, VirtualListBoxItem item) { var pointListBoxItem = item as RoutePointListBoxItem; if (pointListBoxItem != null) { pointListBoxItem.ViewModel = _routePresenter.GetItem(item.Index); } }
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); }
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); }
void OnItemDataNeededHandler(VirtualListBoxItem sender) { if (ItemDataNeeded != null && sender.Index < _itemCount) ItemDataNeeded.Invoke(this, sender); }
private void FilterClick(object sender) { _presenter.ChangeCategoryFilter(); _selectedItem = null; _productPriceListBox.SetListSize(_presenter.InitializeListSize()); }
private void ClearSearchClick(object sender) { _presenter.ClearSearch(); _selectedItem = null; _productPriceListBox.SetListSize(_presenter.InitializeListSize()); }
private void SearchClick(object sender, string criteria) { _presenter.Search(criteria); _selectedItem = null; _productPriceListBox.SetListSize(_presenter.InitializeListSize()); }
private void ItemSelected(object sender, VirtualListBoxItem item) { _selectedItem = item; _presenter.Select(item.Index); _productPickUpExtraPanel.SetUnitsOfMeasures(_presenter.GetProductsUntisOfMeasure()); _productPickUpExtraPanel.SetSelectedUnitOfMeasure(_presenter.SelectedModel.UnitOfMeasureId); }