private void SelectionChanged(object obj) { if (obj != null) { if (obj is CheckableCardModel) { var card = obj as CheckableCardModel; if (card == null) { return; } if (!card.IsChecked && AllCards.Count(x => x.IsChecked) == this._notification.CardsCount) { return; } card.IsChecked = !card.IsChecked; } } }