Это не часть шаблона MVVM. Используйте триггер WPF следующим образом, для цвета фона используйте конвертер.
<Window.Resources>
<conv:BackgroundConverter x:Key="backgroundConverter"/>
<Style TargetType="{x:Type TextBox}" x:Key="ModelBoxStyle">
<Setter Property="IsEnabled" Value="True"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=NoOption,Path=IsChecked}" Value="True" >
<Setter Property="IsEnabled" Value="False"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Background="{Binding Text,ElementName=ModelBox,Converter={StaticResource backgroundConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<RadioButton Content="Yes" x:Name="YesOption" Grid.Column="0"/>
<RadioButton Content="No" x:Name="NoOption" Grid.Column="2"/>
<TextBlock Text="Enter Model :" Grid.Row="1" Grid.Column="0"/>
<TextBox x:Name="ModelBox" MinWidth="100" Height="20" Grid.Row="1" Grid.Column="2" Style="{StaticResource ModelBoxStyle}"
HorizontalAlignment="Center" VerticalAlignment="Top"/>
</Grid>
public class BackgroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string text = value as string;
if (string.IsNullOrEmpty(text))
{
return Brushes.Red;
}
return Brushes.White;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}