In-situ formation of Ag-containing nanoparticles in thin polymer films