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);

        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 27 "..\..\..\View\AllProduct.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CreateProduct);
     
     #line default
     #line hidden
     return;
     case 2:
     
     #line 28 "..\..\..\View\AllProduct.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DeleteProduct);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 29 "..\..\..\View\AllProduct.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Product_Upload);
     
     #line default
     #line hidden
     return;
     case 4:
     
     #line 30 "..\..\..\View\AllProduct.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Product_Synchronization);
     
     #line default
     #line hidden
     return;
     case 5:
     
     #line 31 "..\..\..\View\AllProduct.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Sync_AllProduct);
     
     #line default
     #line hidden
     return;
     case 6:
     this.ProgressBar = ((System.Windows.Controls.ProgressBar)(target));
     return;
     case 9:
     this.ProductEditor = ((uSWOPAssistant.View.ProductEditor)(target));
     return;
     }
     this._contentLoaded = true;
 }