/// <summary> /// Initializes a new instance of the <see cref="AllProduct"/> class. /// </summary> public AllProduct() { _productService = ServiceLocator.Current.GetInstance<IProductService>(); _productViewModel = ServiceLocator.Current.GetInstance<AllProductViewModel>(); _productViewModel.SelectChangeCommand = ProductSelect; InitializeComponent(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(ConfigViewModel configViewModel, ProductEditorViewModel productEditorViewModel, AllProductViewModel productViewModel, FailProductViewModel failproductViewModel) { _configViewModel = configViewModel; _productEditorViewModel = productEditorViewModel; _allproductViewModel = productViewModel; _failproductViewModel = failproductViewModel; _username = AppLocator.Contenxt.UserName; HotStartCommand = new RelayCommand(HotStartAction); }
/// <summary> /// Initializes the specified view model. /// </summary> /// <param name="viewModel">The view model.</param> private void Init(ProductEditorViewModel viewModel) { _productEditorViewModel = viewModel; this.DataContext = viewModel; _productViewModel = ServiceLocator.Current.GetInstance<AllProductViewModel>(); _productService = ServiceLocator.Current.GetInstance<IProductService>(); _configService = ServiceLocator.Current.GetInstance<IConfigService>(); _model = new ProductModel(); InitializeComponent(); _redProductBorderStyle = FindResource("RedProductBorder") as Style; _productBorderStyle = FindResource("ProductBorder") as Style; }