Why is javascript needed?
In any case, if it is really wpf, bind the FontWeight property of your shortcut to the textbox text property using its own converter, which converts null / empty lines to Normal font weight and non-empty / non-empty to Bold.
source
share