Photochromism of a 3D Cd(II) complex with two captured ligand isomers generated in situ from the same precursor.