Just @bind your ActivePanelIndex to a property instead of a field, and do more code in the set
property:
<MudTabs Elevation="0" Outlined="true" @bind-ActivePanelIndex="ActiveIndex">
<MudTabPanel Text="Red"></MudTabPanel>
<MudTabPanel Text="Blue"></MudTabPanel>
</MudTabs>
<MyBox colorBox="@_colorMe" />
@code
{
string _colorMe = "red";
private int _activeIndex;
private int ActiveIndex {
get => _activeIndex;
set {
_activeIndex = value;
_colorMe = new[]{"red","blue"}[_activeIndex]; //or run a method etc
}
}
}