private bool IsValidPlacing(ObservableStack<TowerPlate> tower, TowerPlate plate) => tower.Count != 0 ? tower.Peek() > plate : true;
public void OnAmountOfPlatesChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "AmountOfPlates") { firstTower.Clear(); secondTower.Clear(); thirdTower.Clear(); winTower.Clear(); for (int i = AmountOfPlates; i > 0; i--) { var plate = new TowerPlate() { Weight = i }; firstTower.Push(plate); winTower.Push(plate); } } }