【发布时间】:2016-01-17 01:59:11
【问题描述】:
我有两组独立的单选按钮(在运行时填充)。我面临的问题是这两个组表现为一个组,即从一组中选择某些内容会从另一组中取消选择所选项目。
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Path=AvailableX}" />
</ScrollViewer>
<ScrollViewer>
<ItemsControl ItemsSource="{Binding Path=AvailableY}" />
</ScrollViewer>
public ObservableCollection<RadioButton> AvailableX
{
get
{
return _availableX;
}
set
{
_availableX = value;
}
}
public ObservableCollection<RadioButton> AvailableY
{
get
{
return _availableY;
}
set
{
_availableY = value;
}
}
.....
.....
foreach (var x in _properties)
{
AvailableX.Add(new RadioButton() { Content = x.ToString() });
AvailableY.Add(new RadioButton() { Content = x.ToString() });
}
【问题讨论】:
标签: silverlight data-binding radio-button