private void RefreshSearchComboBox() { // Update Data Grid with new set of products ProductSource = ProductTypeComboBox.SelectedItem != null && ProductComboBox != null ? _productHandler.GetProducts(productType : (ProductType)ProductTypeComboBox.SelectedIndex) : _productHandler.GetItems(); ProductComboBox?.GetBindingExpression(ProductComboBox.ItemsSourceProperty)?.UpdateTarget(); }
public ProductWindow() { _productHandler = new ProductHandler(); _alloywheelHandler = new ProductHandler.AlloywheelHandler(); _batteryHandler = new ProductHandler.BatteryHandler(); _tyreHandler = new ProductHandler.TyreHandler(); ItemSource = _productHandler.GetItems(); ItemTypeSource = Enum.GetNames(typeof(ProductType)).ToList().GetRange(0, 3); LoadAllSources(); InitializeComponent(); UpdateControlVisibility(); }
private AddOrderDialog() { try { _productHandler = new ProductHandler(); Order = new Order(); ProductSource = _productHandler.GetItems(); InitializeComponent(); ProductTypeComboBox.ItemsSource = Enum.GetNames(typeof(ProductType)); ProductTypeComboBox.Focus(); } catch (Exception ex) { // Log.Error(ex.Message); MessageBox.Show("Exception : " + ex.Message); } }
private void RefreshDataGrid() { ItemSource = _productHandler.GetItems(name: SearchTextBox?.Text, productType: (ProductType?)ItemTypeComboBox?.SelectedIndex); InventoryDataGrid?.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget(); }