public AddItemDialog(ProductType productType) { // Load handlers and initialize item _productType = productType; _productHandler = new ProductHandler(); _alloywheelHandler = new ProductHandler.AlloywheelHandler(); _batteryHandler = new ProductHandler.BatteryHandler(); _tyreHandler = new ProductHandler.TyreHandler(); LoadSources(); InitializeComponent(); InitializeUi(); }
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(); }