public CoffeeViewModel() { GroundList = Persistence.GetOrCreateSettings(); foreach (GroundModel Model in GroundList) { Model.Parent = this; Model.PropertyChanged += (s, e) => { NotifyChange("GroundList"); }; } CurrentGround = GroundList[0]; }
public void CreateNewGround() { GroundModel newg = new GroundModel() { Parent = this }; newg.PropertyChanged += (s, e) => { NotifyChange("GroundList"); }; GroundList.Add(newg); CurrentGround = newg; NotifyChange("GroundList"); NotifyChange("CurrentGround"); }