You may be able to replace just the little latches that are supposed to hold it closed. The little square quarter-turn plastic gizmos, for instance, are readily available and just kind of snap into their hole in the door.
A carefully placed magnetic catch (or just a magnet) might work nicely, too.
if it is the typical WFCO panel, and it won't stay latched it's probably the latch pin in the door. Those are avaiable as a replacement part, most any RV shop should have them, if not amazon or ebay probably has them. I had one break on our 2011 Outback and easily found the pin online, but don't recall where it was.
I had the same issue on WFCO panel on a previous trailer. I used a small sheet metal screw to hold the door closed. It's usually pretty seldom that the panel needs to be accessed, and only takes about 10 sec to remove the screw.