public async Task GetNewQuestion() { var questions = await _questions.GetWhiteboardQs(); Random rand = new Random(); int num = rand.Next(questions.Count); int i = 0; while (NumbersUsed.Contains(num)) { i++; if (i == questions.Count) { NumbersUsed = new List <int>(); } num = rand.Next(questions.Count); } NumbersUsed.Add(num); Question = new WhiteboardViewModel() { Question = questions[num].Question }; }
public void SetWhiteboard(WhiteboardViewModel wb) { _whiteboard = wb; _whiteboard.SelectionChanged += _whiteboard_SelectionChanged; }