I am trying to change the ButtonStyle to primary or success based on the value of a variable. If I data-bind the ButtonStyle property it does not compile:
error RZ9986: Component attributes do not support complex content (mixed C# and markup). Attribute: 'ButtonStyle', text: 'ButtonStyle.@myButtonVariable'
${myButtonVariable} is set to "success" or "primary" (string) depending on the style I want to set. I'm assuming it needs changed to something else.
Indeed the syntax you are trying will not work. Your myButtonVariable should be of type ButtonStyle and not a regular string. Alternatively you can try the Enum.Parse method. Set the the ButtonStyle property to Enum.Parse<ButtonStyles>(myButtonVariable, true)