Dynamic interplay between spin-crossover and host-guest function in a nanoporous metal-organic framework material.