private void AddProductToOperation(OperationProductModel operationProduct) { this.productList.Add(operationProduct); dgOperationProducts.ItemsSource = this.productList; dgOperationProducts.Items.Refresh(); this.operation.OperationProducts = this.productList; this.operation.Sum = this.GetSumFromAllProducts(this.productList); }
public OperationProduct() { InitializeComponent(); this._repo = new Repo(); this.operationProduct = this.DataContext as OperationProductModel; cbProducts.ItemsSource = this._repo.GetProducts(); cbProducts.DisplayMemberPath = "Name"; cbProductUnit.ItemsSource = this._repo.GetProductUnits(); cbProductUnit.DisplayMemberPath = "Name"; }