public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged([CallerMemberName] string property = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
}
public class MethodViewModel : BaseViewModel
{
private string _methodName;
public string MethodName
{
get => _methodName;
set
{
_methodName= value;
OnPropertyChange(); //ничего писать не надо
}
}
}
<RadioButton DataContext="{Binding MethodViewModel}" Content="{Binding MethodName}" Command="{Binding ChangeMethodName}"/>