Silverlight 失败项控件绑定
我定义这个类: 类myClass { 字符串键{get;set;} } 和ItemsControlSilverlight 失败项控件绑定,silverlight,Silverlight,我定义这个类: 类myClass { 字符串键{get;set;} } 和ItemsControl <ItemsControl Name="itemsControl" > <ItemsControl.Items> <RadioButton Content="{Binding Key}" /> </ItemsControl.Items> </ItemsContr
<ItemsControl Name="itemsControl" >
<ItemsControl.Items>
<RadioButton Content="{Binding Key}" />
</ItemsControl.Items>
</ItemsControl>
现在,我尝试在代码中调用绑定(itemsControl.ItemsSource或itemsControl.DataContext),但它不起作用(我尝试将myClass的一些列表绑定到itemsControl)您需要将单选按钮放在itemTemplate标记内,而不是items标记内 试试