cannot set the style property of an element it's always empty. When I write out StyleString it says color: red
[Transposed verbatim from the comment]
AT(StyleString = ShouldBeError ? "color: red" : "")
</div>
@StyleString
<MudCard>
<MudCardHeader>
<CardHeaderContent>
<MudText Typo="Typo.h6" Style="AT($"{StyleString}")">
//.....
ATcode {
//...
private bool ShouldBeError;
private string StyleString = "";
private List<Location> Data = new List<Location>();

In MudBlazor you need to use
theme ColorsorPalette colorsLike:Color.Primary,Color.Secondary...etsfor more, see this link