In-situ preparation of a shape stable phase change material