Example #1
0
        public ApplicationViewModel(IServiceProvider serviceProvider)
        {
            about = new AboutViewModel();

            home = new HomeViewModel();

            orders = new OrderViewModel(serviceProvider.GetService <IUnitOfWork>(), serviceProvider.GetService <IOrderService>());

            products = new ProductViewModel(serviceProvider.GetService <IUnitOfWork>(), serviceProvider.GetService <ITransportService>(), serviceProvider.GetService <IOrderService>(),

                                            serviceProvider.GetService <IProductService>(), serviceProvider.GetService <IOrderStatusService>(),

                                            serviceProvider.GetService <IDestinationService>());

            _currentWindowViewModel = products;

            SetAboutVMCommand = new RelayCommand(SetAboutVM);

            SetProductsVMCommand = new RelayCommand(SetProductsVM);

            SetOrdersVMCommand = new RelayCommand(SetOrdersVM);

            ExitCommand = new RelayCommand(Exit);
        }
Example #2
0
        public ApplicationViewModel()
        {
            DependencyRegistration container = new DependencyRegistration();

            container.Build();

            about = new AboutViewModel();

            home = new HomeViewModel();

            orders = new OrderViewModel();

            products = new ProductViewModel();

            _currentWindowViewModel = products;

            SetAboutVMCommand = new RelayCommand(SetAboutVM);

            SetProductsVMCommand = new RelayCommand(SetProductsVM);

            SetOrdersVMCommand = new RelayCommand(SetOrdersVM);

            ExitCommand = new RelayCommand(Exit);
        }