I want to manipulate with background-color of Component "MyBox" using Tabs. Background of Component has to be filled with the color, named in Tabs.One condition: you're not allowed to delete @bind-ActivePanelIndex="activeIndex" from code (it's used for other purposes).I have a method "SetColor", but I don't understand how to run it.I'll be thankfull for any help.
Index.razor
<MudTabs Elevation="0" Outlined="true" @bind-ActivePanelIndex="activeIndex"><MudTabPanel Text="Red"></MudTabPanel><MudTabPanel Text="Blue"></MudTabPanel></MudTabs><MyBox colorBox="@colorMe"/>@code{ int activeIndex = 0; string colorMe = ""; void SetColor() { if(activeIndex == 0) { colorMe = "red"; } else if(activeIndex == 1) { colorMe = "blue"; } }}MyBox.razor
<MudItem Style="@($"background-color:{colorBox}; padding:10px; border:1px solid black")"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eum sit praesentium eos impedit. Est delectus non fugiat perferendis, quos et quis fugit iusto laborum esse voluptates sequi harum quo ab.</MudItem>@code { [Parameter] public string colorBox {get; set;}}