Well, when you say "Would you mind ..."
what you're saying is basically "Would it be too much trouble for me to ask you to ..."
You're asking if it's too much of a bother for the person to fulfill your request, so generally it's said to be a polite way of asking someone to do something that might be a little troublesome. You're basically asking for their consent.
"Would it be too much trouble to ask you to help me with the dishes after dinner?"
, "If you don't mind, can you help me with my homework later?"
, "If it's not too much trouble, can we stop by the store on the way home?"
Of course these can be said sarcastically to make a rude point too, like "If it's not too much trouble could you not leave your dirty clothes laying around everywhere?"
hrm... that makes me think... it seems like usually when you might be being a bit rude with what you're saying, you usually use a negative statement like "Would it be too much trouble to not crank up your stereo all the time?"
or "Would you mind not talking to my girlfriend anymore?"
but I think I'm wandering a bit... maybe someone else has some input on this subject?
"Would you mind doing ..."
← generally polite. (like "I hate to bother you, but..."
"Would you mind NOT doing ..."
← can have a bit of rudeness to it. (like "please stop that, you're irritating me."
I think the "unpleasantness" (when you're being polite) is the thing you're about to ask them to do. You're asking them to do some extra task that might be a bother for them, so you're asking them if it wouldn't be too much trouble for them to do what you're asking.