private void DoShowNext() { var studentVote = StudentVotes.FirstOrDefault(c => c.Position.Id == CurrentPosition.Id); if (studentVote != null) { studentVote.VotedStudent = SelectedCouncilMember?.Student; StudentVotes.Remove(studentVote); AddVote(); StudentVotes = StudentVotes.OrderBy(c => c.Position.Id).ToObservableCollection(); } else { AddVote(); } if (CouncilPositions.IndexOf(CurrentPosition) == CouncilPositions?.IndexOf(CouncilPositions.Last())) { DialogHost.CloseDialogCommand.Execute("Finish", null); RaisePropertyChanged(() => VoteCommand); } else { NextPosition(); } RaisePropertyChanged(() => NextOrFinish); }
private void DoShowNext() { if (StudentVotes != null) { var studentVote = StudentVotes.FirstOrDefault(c => c.Position.Id == CurrentPosition.Id); if (studentVote != null) { studentVote.VotedStudent = SelectedCouncilMember?.Student; StudentVotes.Remove(studentVote); AddVote(); StudentVotes = StudentVotes.OrderBy(c => c.Position.Id).ToObservableCollection(); } else { AddVote(); } } else { AddVote(); } if (_changeOnly) { IsNotFinish = false; } if (_isVoteChange) { _isVoteChange = false; CurrentPosition = _oldPosition; RaisePropertyChanged(() => NextOrFinish); return; } if (CouncilPositions.IndexOf(CurrentPosition) == CouncilPositions?.IndexOf(CouncilPositions.Last())) { IsNotFinish = false; _changeOnly = true; } else { NextPosition(); } RaisePropertyChanged(() => NextOrFinish); }