public MainWindowViewModel() { var client = DependencyInjection.Container.Resolve <IClient>(); LimitOrderViewModel = new NewLimitOrderViewModel(client); ActiveOrdersViewModel = new ActiveOrdersViewModel(client); ExecutionsViewModel = new ClientExecutionsViewModel(client); L1ViewModel = new Level1ViewModel(client); MarketOrderViewModel = new NewMarketOrderViewModel(client); StopLimitOrdersViewModel = new ActiveStopLimitOrdersViewModel(client); }
public MainWindowViewModel(IBtceTradeApi btceTradeApi, IBtceModels btceModels, IConfiguration configuration, ITradingConfigurations tradingConfigurations) { this.btceTradeApi = btceTradeApi; this.btceModels = btceModels; this.configuration = configuration; this.tradingConfigurations = tradingConfigurations; DockedViewModels = new ObservableCollection <IAvalonDockViewModel>(); ActiveOrdersViewModel = new ActiveOrdersViewModel(this.btceTradeApi, this.btceModels); AccountInfoViewModel = new AccountInfoViewModel(this.btceModels); AddDepthCommand = new RelayCommand((parameters) => { var viewModel = new SelectPairViewModel(configuration); var view = new SelectPair(); view.DataContext = viewModel; viewModel.CancelCommand = new RelayCommand((pms) => { view.Close(); }); viewModel.OkCommand = new RelayCommand((pms) => { if (viewModel.SelectedPair != null) { var newMarketDepthViewModel = new MarketDepthViewModel(btceModels, configuration, btceTradeApi, tradingConfigurations, viewModel.SelectedPair); DockedViewModels.Add(newMarketDepthViewModel); view.Close(); } }); view.ShowDialog(); }); }
public ActiveOrders() { InitializeComponent(); BindingContext = new ActiveOrdersViewModel(); }