First thing, hang on to your gun! Press it down hard, so that it can't be drawn. Then, depending on where the BG is, fight dirty. Try to hit groins, eyes, nose, etc. Remember, even a light swipe of the nose will disorient most people, along with being hit in the groin. Once you get free, step back a few paces, and draw on him! Call cops, or have someone do it for you. The best defense for this kind of situation, is a good offense! Don't allow someone to see your gun! Concealed means concealed! The better hidden it is, the lower the chance of it being taken. About the knife, I would just make a huge gash on the inside of the guy's leg, right below the groin, as a major artery runs there, and the guy would bleed out in about 3 min, all the while, quickly becoming weak.
"Where the choice is between only violence and cowardice, I would advise violence."
~ Mohatma Gandhi