It all depends on how thorough they have been with the paperwork. If they have done a HPI check on the car and it shows to be a write off, This really should have been picked up before you collected your "New" car.
Did you sign a section on the order from and invoice concerning your (written off) part exchange? Most reputable dealers will have ensured you done this to cover themselves in this type of situation. There will be a statement saying that you can / cannot confirm the vehicle has had substantial damage and whether it was written off, Have you/ Did you sign this?
If its just a case that it didn't show up on HPI and only come to light after they have inspected the part exchange then you're pretty much in the clear.
Saying that, it all depends on How much they allowed you fro the car and how hard a stance they want to take.