public ProductEditorWindow(ProductModel productModel) : this() { var viewmodel = new ProductEditorViewModel(); var view = new ProductEditor(viewmodel); view.CompleteCommand = this.Close; viewmodel.Init(); view.PrepareProductUi(productModel); MainViewGrid.Children.Clear(); MainViewGrid.Children.Add(view); }
/// <summary> /// Initializes a new instance of the <see cref="AllProduct"/> class. /// </summary> public FailProduct() { _productService = ServiceLocator.Current.GetInstance<IProductService>(); _productViewModel = ServiceLocator.Current.GetInstance<FailProductViewModel>(); _productViewModel.SelectChangeCommand = ProductSelect; InitializeComponent(); var viewmodel = new ProductEditorViewModel(); _productEditor = new ProductEditor(viewmodel); viewmodel.Init(); ProductEditorGrid.Children.Clear(); ProductEditorGrid.Children.Add(_productEditor); }