Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 绑定到枚举的RadioButton显示未选中RadioButton的错误_C#_Wpf_Xaml - Fatal编程技术网

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}"