我试图解决以下绑定表达式错误:
System.Windows.Data Error: 40 : System.Windows.Data Error: 40 : BindingExpression path error: 'DisDetailDisDetailsIndicationQcVisibility' property not found on 'object' ''Wrapped_PrescriptionIndicationViewModel_e11b513f9a5b45059c1351597f748b73' (HashCode=33509524)'. BindingExpression:Path=DisDetailDisDetailsIndicationQcVisibility; DataItem='Wrapped_PrescriptionIndicationViewModel_e11b513f9a5b45059c1351597f748b73' (HashCode=33509524); target element is 'PrescriptionIndicationView' (Name='UserControl'); target property is 'Visibility' (type 'Visibility')
为什么WPF(或者Prism)在这个错误消息中重命名视图模型,前缀为" Wrapped _"并附加一个Guid?显然这不是正确的名称,所以明显的错误告诉我它找不到它。所以我的问题是:为什么要看这个对象?
以下是视图中的XAML:
<Views1:PrescriptionIndicationView TabIndex="155"
Grid.Row="1"
Grid.Column="0"
DataContext="{Binding Path=PrescriptionIndication, Converter={local:ViewModelValueConverter}}"
Visibility="{Binding IndicationsVisibility, Converter={StaticResource BoolToVisConverter}}"
x:Uid="50a00e5b462e43988b7d4c91332b0c6e">
</Views1:PrescriptionIndicationView>