public void DoNextStep(GameSnapshotForNextPlayer snapshot) { lock (syncObject) { if (game != null) { var viewModel = snapshot.ToViewModel(); var availableCells = snapshot.AvailableCells?.Select(coord => coord.ToViewModel()).ToList(); Application.Current.Dispatcher.InvokeAsync(() => game.DoNextStep(viewModel, availableCells)); } } }