Пример #1
0
        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);
        }
Пример #2
0
        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();
            });
        }
Пример #3
0
        public ActiveOrders()
        {
            InitializeComponent();

            BindingContext = new ActiveOrdersViewModel();
        }