示例#1
0
        public void UpdateState(BuyerSnapshot snapshot)
        {
            CurrentPrice  = snapshot.CurrentPrice.ToString();
            NumberInStock = snapshot.NumberInStock.ToString();
            BoughtSoFar   = snapshot.BoughtSoFar.ToString();
            State         = snapshot.State.ToString();

            Notify(nameof(CurrentPrice));
            Notify(nameof(NumberInStock));
            Notify(nameof(BoughtSoFar));
            Notify(nameof(State));
        }
示例#2
0
        public void BuyerStateChanged(BuyerSnapshot snapshot)
        {
            BuyerViewModel viewModel = Buyers.Single(x => x.ItemId == snapshot.ItemId);

            viewModel.UpdateState(snapshot);
        }
示例#3
0
 public BuyerViewModel(string itemId, BuyerSnapshot snapshot)
 {
     ItemId = itemId;
     UpdateState(snapshot);
 }