예제 #1
0
        void kHControlViewModel_ReceiveAccountInfo(object sender, AccountModelArgs e)
        {
            if (e.AccountModel.StCode != this.AccountModel.StCode)
            {
                return;
            }

            this.AccountModel.HaveStockCount = e.AccountModel.HaveStockCount;
            this.AccountModel.GainLossRate   = e.AccountModel.GainLossRate;
            this.AccountModel.GainLoss       = e.AccountModel.GainLoss;
            this.AccountModel.PurchaseAmount = e.AccountModel.PurchaseAmount;
            this.AccountModel.PurchasePrice  = e.AccountModel.PurchasePrice;
            this.AccountModel.EvalPrice      = e.AccountModel.EvalPrice;

            if (this.AccountModel.HaveStockCount == 0)
            {
                //RemoveThis();
            }
        }
        private void KHControlViewModel_ReceiveAccountInfo(object sender, AccountModelArgs e)
        {
            var existsItem = this.TradeControlItems.FirstOrDefault(x => x.AccountModel.StCode.Equals(e.AccountModel.StCode));

            if (existsItem != null)
            {
                return;
            }

            //var findItem = Communicator.RedisClient.Instance.Get<StockInfo>(e.AccountModel.StCode);
            //if (findItem == null)
            //{
            //    return;
            //}

            var tradeControl = new TradeControlViewModel();

            tradeControl.InitMatherControls(this.kHControlViewModel, this, e.AccountModel);

            this.TradeControlItems.Add(tradeControl);
        }