Используйте IValueConverter.
Для данного окна, содержащего вашу радиокнопку и связанные с ней привязки:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="MainWindow" Height="350" Width="525" x:Name="dataGrid_services">
<Window.Resources>
<local:CheckedConverter x:Key="converter"/>
</Window.Resources>
<Grid DataContext="{Binding ElementName=dataGrid_services, Path=SelectedItem}" Width="766">
<RadioButton Content="visit" IsChecked="{Binding Path=type_services, Converter={StaticResource converter}}" FontFamily="Tahoma"/>
</Grid>
Изменения добавляют ссылку на пространство имен для локального (или любого другого)пространство имен, в котором находится ваш конвертер):
xmlns:local="clr-namespace:WpfApplication1"
создание ресурса конвертера:
<Window.Resources>
<local:CheckedConverter x:Key="converter"/>
</Window.Resources>
и использование ресурса конвертера:
IsChecked="{Binding Path=type_services, Converter={StaticResource converter}}"
Преобразователь выглядит следующим образоми просто конвертирует из строки в логическое значение.
public class CheckedConverter : System.Windows.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string typeService = value as string;
if (typeService == "Yes it is")
{
return true;
}
if (typeService == "Nope")
{
return false;
}
return false;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool typeService = (bool)value;
if (typeService)
{
return "Yes it is";
}
else
{
return "Nope";
}
}
}