Пример #1
0
 public BuyViewModel(IStockService stockService, IBuyStockService buyStockService)
 {
     _stockService = stockService;
     _buyStockService = buyStockService;
     SearchSymbolCommand = new RelayCommand<string>((s) => SearchSymbolCmd(s));
     BuyStockCommand = new RelayCommand(BuyStockCmd);
 }
Пример #2
0
        public BuyStockCommand(BuyViewModel buyViewModel, IBuyStockService buyStockService, IAccountStore accountStore)
        {
            _buyViewModel    = buyViewModel;
            _buyStockService = buyStockService;
            _accountStore    = accountStore;

            _buyViewModel.PropertyChanged += BuyViewModel_PropertyChanged;
        }
Пример #3
0
        public BuyViewModel(IStockPriceService stockPriceService, IBuyStockService buyStockService, IAccountStore accountStore)
        {
            SearchSymbolCommand = new SearchSymbolCommand(this, stockPriceService);
            BuyStockCommand     = new BuyStockCommand(this, buyStockService, accountStore);

            ErrorMessageViewModel  = new MessageViewModel();
            StatusMessageViewModel = new MessageViewModel();
        }
Пример #4
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            IServiceProvider serviceProvider = CreateServiceProvider();
            IBuyStockService buyStockService = serviceProvider.GetRequiredService <IBuyStockService>();

            Window window = new MainWindow();

            window.DataContext = serviceProvider.GetRequiredService <MainViewModel>();
            window.Show();

            using (IServiceScope scope = serviceProvider.CreateScope())
            {
                scope.ServiceProvider.GetRequiredService <MainViewModel>();
            }

            base.OnStartup(e);
        }
Пример #5
0
 public BuyStockCommand(BuyViewModel buyViewModel, IBuyStockService buyStockService)
 {
     _buyViewModel    = buyViewModel;
     _buyStockService = buyStockService;
 }
Пример #6
0
 public BuyViewModel(IStockPriceService stockPriceService, IBuyStockService buyStockService)
 {
     SearchSymbolCommand = new SearchSymbolCommand(this, stockPriceService);
     BuyStockCommand     = new BuyStockCommand(this, buyStockService);
 }
Пример #7
0
 public BuyStockCommand(BuyViewModel buyViewModel, IBuyStockService buyStockService, IAccountStore accountStore)
 {
     _buyViewModel    = buyViewModel;
     _buyStockService = buyStockService;
     _accountStore    = accountStore;
 }
Пример #8
0
 public TransactionController(IAuthorizeUserService authorizeUserService, IBuyStockService buyStockService, ISellStockService sellStockService)
 {
     _authorizeUserService = authorizeUserService;
     _buyStockService      = buyStockService;
     _sellStockService     = sellStockService;
 }
 public BuyViewModelFactory(IStockPriceService stockPriceService, IBuyStockService buyStockService)
 {
     this.stockPriceService = stockPriceService;
     this.buyStockService   = buyStockService;
 }