The first time it happens, usually the 2nd day of class, I simply say, in a
friendly tone of voice, "excuse me, I'm not done and I'd appreciate your
attention. The class is over when I dismiss you." It usually takes two or three
reminders but at the end of a week (might be two in college if you don't meet
every day) they get it. And I mean they get it. Occasionally a student will
forget and I simply remind him or her in a friendly voice.