public OrderProductPopup() { InitializeComponent(); this.CenterWindowOnScreen(); vm = this.DataContext as ProductMainOrderLineItem; vm.ProductMainOrderLineItemLoadCommand.Execute(null); vm.RequestClose += (s, e) => this.Close(); }
public ProductLookUp() { InitializeComponent(); this.CenterWindowOnScreen(); vm = this.DataContext as ProductMainOrderLineItem; vm.allowQuantityChangeEvent = true; vm.ProductMainOrderLineItemLoadCommand.Execute(null); vm.RequestClose += (s, e) => this.Close(); }
private void TextBoxQuantity_TextChanged(object sender, TextChangedEventArgs e) { if(vm==null) return; if (! vm.allowQuantityChangeEvent ) { vm.allowQuantityChangeEvent = true; return; } decimal quantity = 0; decimal.TryParse(TextBoxQuantity.Text, out quantity); vm = this.DataContext as ProductMainOrderLineItem; if (vm != null) { vm.Quantity = quantity; vm.ValidQuantityCommand.Execute(e); } }