There are a few things, which should be kept in mind, in respect of the Kashmir Dispute:
1) According to the Pak-China boundary agreement, of 1963, the boundary between both the countries is not final, but provisional, subject to the resolution of the Pak-India Kashmir Dispute.
2) It is not correct that Pakistan handed over Shaksgam Valley to China. Pakistan had no administrative and physical jurisdiction over this desolate and inaccessible area, that handing over would be involved. Pakistan's claim over this area was paper-claim, based on the unilateral boundary lines, drawn by British officials. This paper-claim was settled, on paper, in favor of China. China reciprocated by giving a piece of land to Pakistan, where they had actual administrative jurisdiction and which also involved displacement of Chinese people, living there.
3) Fundamental difference, between India and Pakistan, in respect of boundary settlement, was that Pakistan, unlike India, accepted, at the start, that boundary lines, drawn unilaterally, by the British officials were not sacrosanct and final.
4) As for, whether Aksai Chin was part of erstwhile State of Jammu & Kashmir, or not, Pakistan, as far as I know, maintains a diplomatic silence. The fact of the case is that India's claim on Aksai Chin is highly dubious, without much basis.