private void addProductForm() { dgProducts.SelectedIndex = -1; resetProductForm(true); PFDone.SetResourceReference(ContentControl.ContentProperty, "bAdd"); PFDone.SetResourceReference(ContentControl.ToolTipProperty, "bAdd"); PFDelete.SetResourceReference(ContentControl.ContentProperty, "bCancel"); PFDelete.SetResourceReference(ContentControl.ToolTipProperty, "bCancel"); PFDelete.SetResourceReference(ContentControl.StyleProperty, "MaterialDesignRaisedButton"); }
/// <summary> /// Fill product info befor edit /// </summary> /// <param name="product"></param> private void editProductForm(Product product) { PFTitle.Text = product.Title; PFPriceHT.Text = product.PriceHT.ToString(); PFQentity.Text = product.Quantity.ToString(); PFRef.Text = product.Reference; if (product.Category == null) { PFCat.SelectedIndex = -1; } else { PFCat.Text = product.Category.Title; } PFDes.Text = product.Description; PFDone.SetResourceReference(ContentControl.ContentProperty, "bDone"); PFDone.SetResourceReference(ContentControl.ToolTipProperty, "bDone"); PFDelete.SetResourceReference(ContentControl.ContentProperty, "bDelete"); PFDelete.SetResourceReference(ContentControl.ToolTipProperty, "bDelete"); PFDelete.SetResourceReference(ContentControl.StyleProperty, "MaterialDesignRaisedAccentButton"); setProductForm(); }