Charge battery while camera plugged in and switch to battery mode when power is down

It would be very helpful if batteries can be charged while cameras like the stickup are connected to power directly so in case of power down the camera will switch to battery mode automatically.