We don't have the whole story here, just that you had somebody yank the props out of your hand and expose how it was done.
There are so many ways to deal with this situation. If they were friends or family, then here is how you deal with it. You stand your ground or you can simply nip this problem in the butt before it even rears it's ugly head and learn that you don't perform for your family or friends till much later in the process. This right here, is a bit harder to do because you "WANT" to show your friends or family your new skill or toy. But, it won't work for them. They know you and know that you can't do magic or sleight of hand, so trying to convince them would be a waste of time.
If this was a paid gig, then you either presented the effect with a challenge attitude or just had a bad day. Still the main problem is that you LET the guy/person take the prop away from you. In both situations you need to learn to stand your ground and tell them "No!" and to tell them to back off. Yes, they will probably be offended somewhat, but they will get over it and will hopefully start to learn not to do that anymore.
I was going to suggest to learn to read your audience a little better, but when you audience is your friends or family... That is pretty much a no go for reasons stated above and because they might be your ONLY audience at the moment.