/// <summary> /// add a product by opening a new product window /// the new product window does not have a presenter and the code behind /// only handles validation /// </summary> public void AddProduct() { Product newProduct = new Product(); ProductAddWindowView productAddWindowView = new ProductAddWindowView(newProduct); productAddWindowView.ShowDialog(); if (newProduct != null) { _allProducts.Add(newProduct); _activeProducts = new ObservableCollection <Product>(_allProducts); RaisePropertyChangedEvent("ActiveProducts"); } }
/// <summary> /// add a product by opening a new product window /// the new product window does not have a presenter and the code behind /// only handles validation /// </summary> public void AddProduct() { Product newProduct = new Product(); ProductAddWindowView productAddWindowView = new ProductAddWindowView(newProduct); productAddWindowView.ShowDialog(); //string packUri = "pack://application:,,,/AssemblyName;component/Images/dino.jpg"; //var Source = new ImageSourceConverter().ConvertFromString(packUri) as ImageSource; var uriSource = new Uri("pack://application:,,,/AssemblyName;component/Images/dino.jpg", UriKind.RelativeOrAbsolute); if (newProduct != null) { _allProducts.Add(newProduct); _activeProducts = new ObservableCollection <Product>(_allProducts); RaisePropertyChangedEvent("ActiveProducts"); } }