RadioButton IsChecked失去了约束力

Car*_*rlo 6 wpf binding

我正在试图绑定到RadioButton.IsChecked属性,它只能工作一次.在那之后,绑定不起作用,我不知道为什么会发生这种情况.任何人都可以帮忙吗?谢谢!

这是我的代码.

C#

public partial class Window1 : Window
{
    public Window1()
    {
        InitializeComponent();

        this.DataContext = new ViewModel();
    }
}

public class ViewModel
{
    private bool _isChecked1 = true;
    public bool IsChecked1
    {
        get { return _isChecked1; }
        set
        {
            if (_isChecked1 != value)
            {
                _isChecked1 = value;
            }
        }
    }

    private bool _isChecked2;
    public bool IsChecked2
    {
        get { return _isChecked2; }
        set
        {
            if (_isChecked2 != value)
            {
                _isChecked2 = value;
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

XAML:

<Grid>
    <StackPanel>
        <RadioButton Content="RadioButton1" IsChecked="{Binding IsChecked1}" />
        <RadioButton Content="RadioButton2" IsChecked="{Binding IsChecked2}" />
    </StackPanel>
</Grid>
Run Code Online (Sandbox Code Playgroud)

Ken*_*art 5

这是一个不幸的已知错误.我假设已经在WPF 4.0中修复了新DependencyObject.SetCurrentValueAPI,但尚未验证.