Active heterostructure of crystalline thin-film surface anchored metal-organic frameworks for optoelectronic applications