How can I set the XAML for the first WPF RadioButton in a ListView control to be checked by default?
问题 I have a WPF ListView control containing a number of RadioButton controls using data binding. I'd like the first RadioButton in the group to be checked by default, preferably set in the XAML rather than programmatically, but haven't managed to achieve this. My XAML for the control is: <ListView ItemsSource="{Binding OptionsSortedByKey}" > <ListView.ItemTemplate> <DataTemplate DataType="{x:Type Logging:FilterOptionsRadioListViewModel}"> <RadioButton Content="{Binding Value}" /> </DataTemplate>