C# System.Windows.Controls.RadioButton问题

C# System.Windows.Controls.RadioButton问题,c#,visual-studio-2010,wpf-controls,C#,Visual Studio 2010,Wpf Controls,我正在尝试测试单选按钮是否被选中,并且我不断得到一个错误,即checked和isChecked对于RadioButton类来说不是有效的方法。我正在使用C#和Visual Studio 2010 范例 if (radioButton4.Checked) maxTotal = 660; 此错误似乎特定于System.Windows.Controls.RadioButton类。如果我从代码中创建一个System.Windows.Forms.RadioButton,我不会得到错误。问题是,我从WPF

我正在尝试测试单选按钮是否被选中,并且我不断得到一个错误,即checked和isChecked对于
RadioButton
类来说不是有效的方法。我正在使用C#和Visual Studio 2010

范例

if (radioButton4.Checked) maxTotal = 660;
此错误似乎特定于
System.Windows.Controls.RadioButton
类。如果我从代码中创建一个
System.Windows.Forms.RadioButton
,我不会得到错误。问题是,我从WPF控件工具箱拖到舞台上(我来自as3)的
单选按钮属于
System.Windows.Controls
类型

我需要弄清楚如何将
System.Windows.Forms
各种RadioButton添加到我的工具箱中,或者弄清楚为什么选中的属性对于控件版本无效。这没有道理。我看过的每一个地方都说这应该管用


我创建了一个WPF应用程序。我正在使用其中一个表单控件来做一些我认为没有它就无法完成的事情。据我所知,表单组件旨在与Windows表单应用程序一起使用。所以我的问题可能与此有关,但我不知道。

要检查是否选中了WPF切换按钮,请使用
IsChecked
属性。 System.Windows.Controls.RadioButton是ToggleButton的子类

如果不是绝对必要的,则不应将WPF和Windows窗体控件混合使用。

对于WPF,请尝试使用IsChecked?