Open up steam, go to your library. Right click on Team Fortress 2, click on Properties. Go to the Local Files Tab, and click on "Verify Game Cache." You'll need to close out of Hammer for this process to start, so make sure your project is saved before you close it. Depending on how much you have for files in TF2, it may take a while. It'll download whatever piece of the UI or files are missing that's making Hammer break.