9
我在我的程序中有一个ItemsControl
,其中包含单选按钮列表。获取组中的选定单选按钮(WPF)
<ItemsControl ItemsSource="{Binding Insertions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<RadioButton GroupName="Insertions"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
如何找到组Insertions
在MVVM方式在选定的单选按钮?
我在互联网上找到的大多数示例都涉及到设置单个布尔属性,您可以在转换器的帮助下将IsChecked
属性绑定到该属性。
有没有相当于我可以绑定的ListBox
SelectedItem
?