コード例 #1
0
 /// <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();
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 /// <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;
 }