The ribbon is an application object, not a document object.
Your code needs to handle the
DocumentChange event so that you can refresh the ribbon when the active document changes.
Your toggle buttons also need to have GetPressed callbacks so that the button reflects the current state of the property that is being toggled.