C# 绑定到枚举的RadioButton显示未选中RadioButton的错误
我有两个单选按钮,分别具有左右选项:C# 绑定到枚举的RadioButton显示未选中RadioButton的错误,c#,wpf,xaml,C#,Wpf,Xaml,我有两个单选按钮,分别具有左右选项: <RadioButton Content="Right" Margin="5" VerticalAlignment="Center" IsChecked="{Binding Path=Direction, Mode=TwoWay, Converter={StaticResource EnumConverter}, ConverterParameter=Right}"/> <RadioButton Content="Left" Margin=
<RadioButton Content="Right" Margin="5" VerticalAlignment="Center" IsChecked="{Binding Path=Direction, Mode=TwoWay, Converter={StaticResource EnumConverter}, ConverterParameter=Right}"/>
<RadioButton Content="Left" Margin="5" VerticalAlignment="Center" IsChecked="{Binding Path=Direction, Mode=TwoWay, Converter={StaticResource EnumConverter}, ConverterParameter=Left}"/>
现在,当我选择单选按钮Right时,Left选项会在带有Left的单选按钮控件周围显示一个红色边框;反之亦然
如何解决这个问题
找到了解决方案,添加它以防有人需要
问题是,它试图从应用程序中选择验证样式。
所以我必须用它来装饰单选按钮的每个元素
Validation.ErrorTemplate="{x:Null}"
谢谢 它在单选按钮周围显示了一个红色边框,我想这是绑定问题。在输出窗口中,您是否看到任何消息?outputValidation中没有错误/消息。ErrorTemplate={x:Null}完成了该操作
Validation.ErrorTemplate="{x:Null}"