WPF Radiobutton (two) (binding to boolean value)
问题 I have a property of type boolean presented with checkbox. I want to change that to two radiobuttons that bind on the same property presenting the value true/false. How can that be done? 回答1: <RadioButton GroupName="Group1" IsChecked="{Binding PropertyValue}" Content="Yes" /> <RadioButton GroupName="Group1" Content="No" IsChecked="{Binding PropertyValue, Converter={StaticResource BoolInverterConverter}}" /> public class BoolInverterConverter : IValueConverter { #region IValueConverter Members