9
我在我的程序中有一個ItemsControl
,其中包含單選按鈕列表。獲取組中的選定單選按鈕(WPF)
<ItemsControl ItemsSource="{Binding Insertions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<RadioButton GroupName="Insertions"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
如何找到組Insertions
在MVVM方式在選定的單選按鈕?
我在互聯網上找到的大多數示例都涉及到設置單個布爾屬性,您可以在轉換器的幫助下將IsChecked
屬性綁定到該屬性。
有沒有相當於我可以綁定的ListBox
SelectedItem
?