She has started walking out of the bathroom with her pants half down as she walks to another room. It does not appear that she is unaware of what she is doing and is not doing this for shock value. She is just doing this. Asking her to "please don't leave your pants down" is not getting any response from her. Her issues are vascular dementia.
I would just assist, close the door - oops here's your pants, tell other family members - "grandma's not decent" etc. so they don't have to encounter the incident. There is no correcting here and it will become normal behavior. Sorry.
We now use the "honor system" and the door is blocked open with a doorstop. At the same time, I put a grab bar right on the outside of the door so with the door blocked open, the grab bar is inside the bathroom.
This is a good time to remember we were all put on this earth in our birthday suits. And really, very few of us look good in our birthday suits :(
This is a GREAT time to make sure mom's hands are properly washed. My mother will use antibacterial handwash in lieu of washing, and it's a good "short term" answer, but not a replacement when there is soap, warm water and a good scrub is in order.
Keeping her hands cleaner will also benefit her in other areas: her glasses, any touch pad, light switches, etc., will be much cleaner. I clean my mother's glasses, phone, walker and all the doorknobs and switches every time I visit. Sometimes I wonder if she's washing her hands at all!!
We cannot fix a problem until and unless we understand what it is.
I had to purchase a 'free standing toilet paper roller' because my DH was reaching too far and the fear of him falling off the commode was very real. I also had to put 'grab bars' in several spots so he can go from one to the next without reaching too far.
If she locks the door, by the way, it would be no bad thing to take the lock off. Because the day will surely dawn when she can't operate it any more, and you don't want her to be on the wrong side of it when that happens (or, God forbid, she falls). Just put a sign or a post it note on the door reminding family members to knock before entering!
Another silver lining is that it will also be an opportunity to make sure your mother has managed to wash her hands properly and hasn't left the hot water tap running... ah happy days, this question is really taking me back!
There is probably some kind of logic (to her) behind this. Is she wet and going in search of clean clothes? Or looking for her incontinence supplies? Or she is "air drying" because she can't remember how to use toilet paper? Even if you can figure out the cause you may not be able to change her behaviour, it may be time for you to take a more active role in her toileting routine.