AI OnAI Off
That will not work because the TextFragment model is based on the HtmlFragment, which does not include a Class property. The form fields are all based on XFormsFragment, which does include a Class prop. In the form builder, a Heading has a class field, though. So why would EpiServer have that field available and not be able to access it?
In Xforms, you can insert a Header, which has two fields - Text and Css Class. I can get the text by using @Model.Value, but how can I access the class name input from my code?