async void OnLoaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) { return; } _product = await _productRepository.GetProductAsync(ProductId); if (_product != null) { ProductTextBox.Text = _product.ProductName; DescriptionTextBox.Text = _product.Description; PriceTextBox.Text = _product.price.ToString(); CategoryTextBox.Text = _product.category; } }
async void Onloaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) { return; } _products = await _productRepostory.GetProductAsync(ProductId); if (_products != null) { txtProductname.Text = _products.ProductName; txtDiscription.Text = _products.Description; txtPrice.Text = _products.Price.ToString(); txtCategory.Text = _products.Category; } }
async void Onloaded(object sender, RoutedEventArgs e) { _products = await _productRepostory.GetProductAsync(ProductId); this.DataContext = _products; }
private void GetAllProducts() { _allProducts = _productRepository.GetProductAsync().Result; }
public async void LoadProduct() { Product = await _productRepository.GetProductAsync(ProductId); }