Esempio n. 1
0
 /// <summary>
 /// Show the chart windows from stock 
 /// </summary>
 public static void ShowStockChartDialog(IStockQueryService queryService, RealTimeStockItem stockItem)
 {
     StockMainChartPanel chartPanel = new StockMainChartPanel();
     StockMainChartViewModel chartMainViewModel = new StockMainChartViewModel(chartPanel, queryService, stockItem);
     chartPanel.DataContext = chartMainViewModel;
     chartPanel.Show();
     chartMainViewModel.Load();
 }
Esempio n. 2
0
        private void StockItem_DoubleClick(RealTimeStockItem realTimeStock)
        {
            //StockInfoItem stockItemInfo = new StockInfoItem
            //{
            //    Id = realTimeStock.Id,
            //    MarketType = realTimeStock.ExchangeTypeKey,
            //    Name = realTimeStock.Name
            //};

            Dialog.ShowStockChartDialog(_queryService, realTimeStock);
        }
Esempio n. 3
0
        /// <summary>
        /// Start to auto update the stock according to the interval
        /// </summary>
        /// <param name="interval">Interval time(sec)</param>

        public void Update(RealTimeStockItem newData)
        {
            this.ChangePercentage   = newData.ChangePercentage;
            this.ChangePrice        = newData.ChangePrice;
            this.CurrentPrice       = newData.CurrentPrice;
            this.HighestPrice       = newData.HighestPrice;
            this.LowestPrice        = newData.LowestPrice;
            this.Volumes            = newData.Volumes;
            this.LatestTime         = newData.LatestTime;
            this.CurrentTimeVolumes = newData.CurrentTimeVolumes;
            this.BuyPriceList       = newData.BuyPriceList;
            this.BuyQuantityList    = newData.BuyQuantityList;
            this.SellPriceList      = newData.SellPriceList;
            this.SellQuantityList   = newData.SellQuantityList;
        }
 public StockMainChartViewModel(IStockChartPanelView chartView, IStockQueryService queryService, RealTimeStockItem realtimeStock)
 {
     StockValueChart = new StockValueChartViewModel(chartView.StockValueChartView, queryService, realtimeStock);
     _realtimeStockModel = realtimeStock;
 }
 /// <summary>
 /// Start to auto update the stock according to the interval
 /// </summary>
 /// <param name="interval">Interval time(sec)</param>
 public void Update(RealTimeStockItem newData)
 {
     this.ChangePercentage = newData.ChangePercentage;
     this.ChangePrice = newData.ChangePrice;
     this.CurrentPrice = newData.CurrentPrice;
     this.HighestPrice = newData.HighestPrice;
     this.LowestPrice = newData.LowestPrice;
     this.Volumes = newData.Volumes;
     this.LatestTime = newData.LatestTime;
     this.CurrentTimeVolumes = newData.CurrentTimeVolumes;
     this.BuyPriceList = newData.BuyPriceList;
     this.BuyQuantityList = newData.BuyQuantityList;
     this.SellPriceList = newData.SellPriceList;
     this.SellQuantityList = newData.SellQuantityList;
 }