public AccountMgrVM(IEventAggregator evtAgg, ServerAddressRepoVM serverAddrRepoVm) { evtAgg.GetEvent <AppShutDown>().Subscribe(OnAppShutDown); evtAgg.GetEvent <AccountChangedEvent>().Subscribe(OnCertainAccountChanged); evtAgg.GetEvent <CloseMlOrderEvent>().Subscribe(OnClosePosition); evtAgg.GetEvent <CancelOrderEvent>().Subscribe(OnCancelOrder); _addAccountCommand = new DelegateCommand(OnAddAccount); _editAccountCommand = new DelegateCommand <XamDataTree>(OnEditAccount); _removeAccountCommand = new DelegateCommand <XamDataTree>(OnRemoveAccount); //_accounts.Add(new AccountVM() { BrokerId="0240", InvestorId="0240050008", Password="******" }); // load server address list ServerAddrRepoVM = serverAddrRepoVm; serverAddrRepoVm.LoadServerList(); Load(); }
public AccountMgrVM(IEventAggregator evtAgg, ServerAddressRepoVM serverAddrRepoVm) { evtAgg.GetEvent <AppShutDown>().Subscribe(OnAppShutDown); evtAgg.GetEvent <AccountChangedEvent>().Subscribe(OnCertainAccountChanged); evtAgg.GetEvent <CloseMlOrderEvent>().Subscribe(OnClosePosition); evtAgg.GetEvent <CancelOrderEvent>().Subscribe(OnCancelOrder); _addAccountCommand = new DelegateCommand(OnAddAccount); _editAccountCommand = new DelegateCommand <XamDataTree>(OnEditAccount); _removeAccountCommand = new DelegateCommand <XamDataTree>(OnRemoveAccount); StartAccountCommand = new DelegateCommand(OnStartAllAccount); StopAccountCommand = new DelegateCommand(OnStopAllAccount); // load server address list ServerAddrRepoVM = serverAddrRepoVm; serverAddrRepoVm.LoadServerList(); Load(); }