public PositionSummaryPresentationModel(IPositionSummaryView view, IAccountPositionService accountPositionService
                                                , IMarketFeedService marketFeedSvc
                                                , IMarketHistoryService marketHistorySvc
                                                , ITrendLinePresenter trendLinePresenter
                                                , IOrdersController ordersController
                                                , IEventAggregator eventAggregator)
        {
            View = view;
            AccountPositionSvc = accountPositionService;
            MarketHistorySvc   = marketHistorySvc;
            EventAggregator    = eventAggregator;
            MarketFeedSvc      = marketFeedSvc;

            PositionSummaryItems = new ObservableCollection <PositionSummaryItem>();

            PopulatePresentationModel();
            BuyCommand  = ordersController.BuyCommand;
            SellCommand = ordersController.SellCommand;

            View.Model          = this;
            _trendLinePresenter = trendLinePresenter;
            View.ShowTrendLine(trendLinePresenter.View);

            //Initially show the FAKEINDEX
            trendLinePresenter.OnTickerSymbolSelected("FAKEINDEX");

            eventAggregator.GetEvent <MarketPricesUpdatedEvent>().Subscribe(MarketPricesUpdated, ThreadOption.UIThread);

            InitializeEvents();
        }
        public OrderDetailsPresentationModel(IOrderDetailsView view, IAccountPositionService accountPositionService, IOrdersService ordersService)
        {
            View = view;
            this.accountPositionService = accountPositionService;
            this.ordersService          = ordersService;

            _transactionInfo = new TransactionInfo();

            //use localizable enum descriptions
            AvailableOrderTypes = new List <ValueDescription <OrderType> >
            {
                new ValueDescription <OrderType>(OrderType.Limit, Resources.OrderType_Limit),
                new ValueDescription <OrderType>(OrderType.Market, Resources.OrderType_Market),
                new ValueDescription <OrderType>(OrderType.Stop, Resources.OrderType_Stop)
            };

            AvailableTimesInForce = new List <ValueDescription <TimeInForce> >
            {
                new ValueDescription <TimeInForce>(TimeInForce.EndOfDay, Resources.TimeInForce_EndOfDay),
                new ValueDescription <TimeInForce>(TimeInForce.ThirtyDays, Resources.TimeInForce_ThirtyDays)
            };

            View.Model = this;
            ValidateModel();

            SubmitCommand          = new DelegateCommand <object>(Submit, CanSubmit);
            CancelCommand          = new DelegateCommand <object>(Cancel);
            SubmitCommand.IsActive = view.IsActive;
            CancelCommand.IsActive = view.IsActive;

            view.IsActiveChanged += view_IsActiveChanged;
        }
        public PositionSummaryPresentationModel(IPositionSummaryView view, IAccountPositionService accountPositionService
                                        , IMarketFeedService marketFeedSvc
                                        , IMarketHistoryService marketHistorySvc
                                        , ITrendLinePresenter trendLinePresenter
                                        , IOrdersController ordersController
                                        , IEventAggregator eventAggregator)
        {
            View = view;
            AccountPositionSvc = accountPositionService;
            MarketHistorySvc = marketHistorySvc;
            EventAggregator = eventAggregator;
            MarketFeedSvc = marketFeedSvc;

            PositionSummaryItems = new ObservableCollection<PositionSummaryItem>();

            PopulatePresentationModel();
            BuyCommand = ordersController.BuyCommand;
            SellCommand = ordersController.SellCommand;

            View.Model = this;
            _trendLinePresenter = trendLinePresenter;
            View.ShowTrendLine(trendLinePresenter.View);

            //Initially show the FAKEINDEX
            trendLinePresenter.OnTickerSymbolSelected("FAKEINDEX");

            eventAggregator.GetEvent<MarketPricesUpdatedEvent>().Subscribe(MarketPricesUpdated, ThreadOption.UIThread);

            InitializeEvents();

        }
Example #4
0
        public OrderDetailsViewModel(IAccountPositionService accountPositionService, IOrdersService ordersService)
        {
            this.accountPositionService = accountPositionService;
            this.ordersService          = ordersService;

            this.transactionInfo = new TransactionInfo();

            //use localizable enum descriptions
            this.AvailableOrderTypes = new ValueDescriptionList <OrderType>
            {
                new ValueDescription <OrderType>(OrderType.Limit, Resources.OrderType_Limit),
                new ValueDescription <OrderType>(OrderType.Market, Resources.OrderType_Market),
                new ValueDescription <OrderType>(OrderType.Stop, Resources.OrderType_Stop)
            };

            this.AvailableTimesInForce = new ValueDescriptionList <TimeInForce>
            {
                new ValueDescription <TimeInForce>(TimeInForce.EndOfDay, Resources.TimeInForce_EndOfDay),
                new ValueDescription <TimeInForce>(TimeInForce.ThirtyDays, Resources.TimeInForce_ThirtyDays)
            };

            this.SubmitCommand = new DelegateCommand <object>(this.Submit, this.CanSubmit);
            this.CancelCommand = new DelegateCommand <object>(this.Cancel);

            this.SetInitialValidState();
        }
        public OrderDetailsViewModel(IAccountPositionService accountPositionService, IOrdersService ordersService)
        {
            this.accountPositionService = accountPositionService;
            this.ordersService = ordersService;

            this.transactionInfo = new TransactionInfo();

            //use localizable enum descriptions
            this.AvailableOrderTypes = new ValueDescriptionList<OrderType>
                                        {
                                            new ValueDescription<OrderType>(OrderType.Limit, Resources.OrderType_Limit),
                                            new ValueDescription<OrderType>(OrderType.Market, Resources.OrderType_Market),
                                            new ValueDescription<OrderType>(OrderType.Stop, Resources.OrderType_Stop)
                                        };

            this.AvailableTimesInForce = new ValueDescriptionList<TimeInForce>
                                          {
                                              new ValueDescription<TimeInForce>(TimeInForce.EndOfDay, Resources.TimeInForce_EndOfDay),
                                              new ValueDescription<TimeInForce>(TimeInForce.ThirtyDays, Resources.TimeInForce_ThirtyDays)
                                          };

            this.SubmitCommand = new DelegateCommand<object>(this.Submit, this.CanSubmit);
            this.CancelCommand = new DelegateCommand<object>(this.Cancel);

            this.SetInitialValidState();
        }
        public OrderDetailsPresentationModel(IOrderDetailsView view, IAccountPositionService accountPositionService, IOrdersService ordersService)
        {
            View = view;
            this.accountPositionService = accountPositionService;
            this.ordersService = ordersService;

            _transactionInfo = new TransactionInfo();

            //use localizable enum descriptions
            AvailableOrderTypes = new List<ValueDescription<OrderType>>
                                        {
                                            new ValueDescription<OrderType>(OrderType.Limit, Resources.OrderType_Limit),
                                            new ValueDescription<OrderType>(OrderType.Market, Resources.OrderType_Market),
                                            new ValueDescription<OrderType>(OrderType.Stop, Resources.OrderType_Stop)
                                        };

            AvailableTimesInForce = new List<ValueDescription<TimeInForce>>
                                          {
                                              new ValueDescription<TimeInForce>(TimeInForce.EndOfDay, Resources.TimeInForce_EndOfDay),
                                              new ValueDescription<TimeInForce>(TimeInForce.ThirtyDays, Resources.TimeInForce_ThirtyDays)
                                          };

            View.Model = this;
            ValidateModel();

            SubmitCommand = new DelegateCommand<object>(Submit, CanSubmit);
            CancelCommand = new DelegateCommand<object>(Cancel);
            SubmitCommand.IsActive = view.IsActive;
            CancelCommand.IsActive = view.IsActive;

            view.IsActiveChanged += view_IsActiveChanged;
        }
 public OrdersController(IRegionManager regionManager, StockTraderRICommandProxy commandProxy, IAccountPositionService accountPositionService)
 {
     _regionManager = regionManager;
     _accountPositionService = accountPositionService;
     this.commandProxy = commandProxy;
     BuyCommand = new DelegateCommand<string>(OnBuyExecuted);
     SellCommand = new DelegateCommand<string>(OnSellExecuted);
     SubmitAllVoteOnlyCommand = new DelegateCommand(() => { }, SubmitAllCanExecute);
     OrderModels = new List<IOrderCompositeViewModel>();
     commandProxy.SubmitAllOrdersCommand.RegisterCommand(SubmitAllVoteOnlyCommand);
 }
Example #8
0
 public OrdersController(IRegionManager regionManager, TradeSysCommandProxy commandProxy, IAccountPositionService accountPositionService)
 {
     _regionManager          = regionManager;
     _accountPositionService = accountPositionService;
     this.commandProxy       = commandProxy;
     BuyCommand  = new DelegateCommand <string>(OnBuyExecuted);
     SellCommand = new DelegateCommand <string>(OnSellExecuted);
     SubmitAllVoteOnlyCommand = new DelegateCommand(() => { }, SubmitAllCanExecute);
     OrderModels = new List <IOrderCompositeViewModel>();
     commandProxy.SubmitAllOrdersCommand.RegisterCommand(SubmitAllVoteOnlyCommand);
 }
Example #9
0
 public OrdersController(IRegionManager regionManager, IUnityContainer container, StockTraderRICommandProxy commandProxy, IAccountPositionService accountPositionService)
 {
     _regionManager           = regionManager;
     _container               = container;
     _accountPositionService  = accountPositionService;
     this.commandProxy        = commandProxy;
     BuyCommand               = new DelegateCommand <string>(OnBuyExecuted);
     SellCommand              = new DelegateCommand <string>(OnSellExecuted);
     SubmitAllVoteOnlyCommand = new DelegateCommand <object>(null, SubmitAllCanExecute);
     OrderModels              = new List <IOrderCompositePresentationModel>();
     commandProxy.SubmitAllOrdersCommand.RegisterCommand(SubmitAllVoteOnlyCommand);
 }
        public ObservablePosition(IAccountPositionService accountPositionService, IMarketFeedService marketFeedService, IEventAggregator eventAggregator)
        {
            this.Items = new ObservableCollection<PositionSummaryItem>();

            this.accountPositionService = accountPositionService;
            this.marketFeedService = marketFeedService;

            eventAggregator.GetEvent<MarketPricesUpdatedEvent>().Subscribe(MarketPricesUpdated, ThreadOption.UIThread);

            PopulateItems();

            this.accountPositionService.Updated += PositionSummaryItems_Updated;
        }
Example #11
0
        public ObservablePosition(IAccountPositionService accountPositionService, IMarketFeedService marketFeedService, IEventAggregator eventAggregator)
        {
            this.Items = new ObservableCollection <PositionSummaryItem>();

            this.accountPositionService = accountPositionService;
            this.marketFeedService      = marketFeedService;

            eventAggregator.GetEvent <MarketPricesUpdatedEvent>().Subscribe(MarketPricesUpdated, ThreadOption.UIThread);

            PopulateItems();

            this.accountPositionService.Updated += PositionSummaryItems_Updated;
        }
Example #12
0
        public OrdersController(IContainerProvider containerProvider, IRegionManager regionManager, StockTraderRICommandProxy commandProxy, IAccountPositionService accountPositionService)
        {
            _regionManager          = regionManager;
            _containerProvider      = containerProvider;
            _accountPositionService = accountPositionService;
            _commandProxy           = commandProxy ?? throw new ArgumentNullException("commandProxy");

            BuyCommand  = new DelegateCommand <string>(OnBuyExecuted);
            SellCommand = new DelegateCommand <string>(OnSellExecuted);
            SubmitAllVoteOnlyCommand = new DelegateCommand(() => { }, SubmitAllCanExecute);

            OrderModels = new List <IOrderCompositeViewModel>();
            //_commandProxy.SubmitAllOrdersCommand.RegisterCommand(SubmitAllVoteOnlyCommand);
        }
Example #13
0
        public OrdersController(IRegionManager regionManager, StockTraderTransaqCommandProxy commandProxy, IAccountPositionService accountPositionService)
        {
            if (commandProxy == null)
            {
                throw new ArgumentNullException("commandProxy");
            }

            _regionManager          = regionManager;
            _accountPositionService = accountPositionService;
            this.commandProxy       = commandProxy;
            BuyCommand  = new DelegateCommand <string>(OnBuyExecuted);
            SellCommand = new DelegateCommand <string>(OnSellExecuted);
            SubmitAllVoteOnlyCommand = new DelegateCommand(() => { }, SubmitAllCanExecute);
            OrderModels = new List <IOrderCompositeViewModel>();
            commandProxy.SubmitAllOrdersCommand.RegisterCommand(SubmitAllVoteOnlyCommand);
        }
 public TestableOrderDetailsPresenter(IOrderDetailsView view, IAccountPositionService accountPositionService)
     : this(view, accountPositionService, new MockOrdersService())
 {
 }
 private static OrderDetailsPresentationModel CreatePresentationModel(IOrderDetailsView view, IAccountPositionService accountPositionService)
 {
     return new OrderDetailsPresentationModel(view, accountPositionService, new MockOrdersService());
 }
 private static OrderDetailsViewModel CreateViewModel(IAccountPositionService accountPositionService)
 {
     return(new OrderDetailsViewModel(accountPositionService, new MockOrdersService()));
 }
Example #17
0
 private static OrderDetailsPresentationModel CreatePresentationModel(IOrderDetailsView view, IAccountPositionService accountPositionService)
 {
     return(new OrderDetailsPresentationModel(view, accountPositionService, new MockOrdersService()));
 }
Example #18
0
 public TestableOrdersController(IRegionManager regionManager, MockStockTraderTransaqCommandProxy commandProxy, IAccountPositionService accountPositionService)
     : base(regionManager, commandProxy, accountPositionService)
 {
 }
 public TestableOrdersController(IRegionManager regionManager, MockStockTraderRICommandProxy commandProxy, IAccountPositionService accountPositionService)
     : base(regionManager, commandProxy, accountPositionService)
 {
 }
 public TestableOrderDetailsPresenter(IOrderDetailsView view, IAccountPositionService accountPositionService, IOrdersService ordersService)
     : base(view, accountPositionService, ordersService)
 {
 }
        public TestableOrderDetailsPresenter(IOrderDetailsView view, IAccountPositionService accountPositionService, IOrdersService ordersService)
            : base(view, accountPositionService, ordersService)
        {

        }
 private static OrderDetailsViewModel CreateViewModel(IAccountPositionService accountPositionService)
 {
     return new OrderDetailsViewModel(accountPositionService, new MockOrdersService());
 }
 public TestableOrderDetailsPresenter(IOrderDetailsView view, IAccountPositionService accountPositionService)
     : this(view, accountPositionService, new MockOrdersService())
 {
 }