0
我有一个绑定的数据网格视图以下问题类别:XAML单选按钮
public class Questions()
{
public int QuestionId{get; set;}
public string Question {get; set;}
public List<Answers> AvailableAnswers {get; Set;}
public string SelectedAnswer {get; set;}
}
public class Answers()
{
public int AnswerId {get; set;}
public string Answer {get; set;}
public bool IsSelected {get; set;}
}
我需要的是在我的Datagrid中显示可用的答案单选按钮,当用户选择无线之一将AnswerId的按钮设置为Questions类中的SelectedAnswer属性。
谁能帮助我一直转圈圈试图做到这一点
也许你需要一个自定义的IValueConverter(SL标准答案#2)。 – jv42
看看这个问题的答案: http://stackoverflow.com/questions/2284752/mvvm-binding-radio-buttons-to-a-view-model – opedog