Switching of a spin-crossover-material incorporated in metal-organic frameworks by a reversible ligand-substitution reaction in the crystalline state.