private void CallCompletedAction() { if (this.completedAction != null) { ComputerMoveData result = new ComputerMoveData { Move = this.PlayLocation, Time = this.MoveTime, IsGameWon = this.IsGameWon, PlayerX = this.MoveIsPlayerX() }; Action callWrapper = () => this.completedAction(result); Application.Current.Dispatcher.BeginInvoke(callWrapper); } }