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

            _buyViewModel.PropertyChanged += BuyViewModel_PropertyChanged;
        }
Example #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();
        }
Example #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);
        }
Example #5
0
 public BuyStockCommand(BuyViewModel buyViewModel, IBuyStockService buyStockService)
 {
     _buyViewModel    = buyViewModel;
     _buyStockService = buyStockService;
 }
Example #6
0
 public BuyViewModel(IStockPriceService stockPriceService, IBuyStockService buyStockService)
 {
     SearchSymbolCommand = new SearchSymbolCommand(this, stockPriceService);
     BuyStockCommand     = new BuyStockCommand(this, buyStockService);
 }
Example #7
0
 public BuyStockCommand(BuyViewModel buyViewModel, IBuyStockService buyStockService, IAccountStore accountStore)
 {
     _buyViewModel    = buyViewModel;
     _buyStockService = buyStockService;
     _accountStore    = accountStore;
 }
Example #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;
 }