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));
        }
Exemple #2
0
        public void BuyerStateChanged(BuyerSnapshot snapshot)
        {
            BuyerViewModel viewModel = Buyers.Single(x => x.ItemId == snapshot.ItemId);

            viewModel.UpdateState(snapshot);
        }
 public BuyerViewModel(string itemId, BuyerSnapshot snapshot)
 {
     ItemId = itemId;
     UpdateState(snapshot);
 }