In situ measurement of thermodynamic partitioning in open hydrogels.