I think people are being very unfair to DP here. He cannot just switch off his depression, he said he didn't want children and appeared to be quite adamant about it and now , in the middle of the worst moments of his life, he's found out he is going to be a dad
Saying "he needs to change his priorities.." it doesn't work like that
I'm worried your DP may get suicidal once your child is here, if he already has the view the rest of his life will be miserable
It's unfair that you have to go through this extra stress whist carrying a baby, but for the sake of everyone's health, wellbeing and sanity, please try and get your DP more help and more counselling. This may spiral when baby arrives.
Saying "well he knew the risk... he needs to sort his priorities... he should've been sterilised" is not helpful at all. He needs help, now.
I'm sorry your having to go through this OP, my heart truly does go out to you, but please help your DP seek more professional help or I worry you may end up a single parent one way or another. A conversation is not enough here, he needs more