ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
这个问题一般出现在Triggers中Property指定的类型为Nullable。 解决办法就是用DataTrigger代替Trigger, 然后用Binding+Converter转换为具体非Null值。 比如: <Style x:Key="DisableStyle" TargetType="Button">            <Style.Triggers>                <MultiDataTrigger>                    <MultiDataTrigger.Conditions>                        <Condition Binding="{Binding ElementName=ckb1, Path=IsChecked, Converter={StaticResource NullableToBooleanConverter}}" Value="true"></Condition>                        <Condition Binding="{Binding ElementName=ckb2, Path=IsChecked, Converter={StaticResource NullableToBooleanConverter}}" Value="true"></Condition>                    </MultiDataTrigger.Conditions>                    <Setter Property="IsEnabled" Value="False"></Setter>                </MultiDataTrigger>            </Style.Triggers>        </Style> NullableToBooleanConverter: public object Convert( object value , Type targetType, object parameter, CultureInfo culture )        {            Nullable<bool > isCheck = value as Nullable< bool>;            if (null == isCheck)            {                return false ;            }            else            {                return isCheck .Value;            }        }