【发布时间】:2011-03-09 03:33:52
【问题描述】:
更新:
我在 SelectedValue 属性 (diagnostics:PresentationTraceSources.TraceLevel=High) 中包含了一些诊断信息,我想我可以看到这个问题,尽管我不知道如何解决它。诊断显示
System.Windows.Data Warning: 76 : BindingExpression (hash=16001149): TransferValue - got raw value '3'
System.Windows.Data Warning: 80 : BindingExpression (hash=16001149): TransferValue - implicit converter produced '3'
System.Windows.Data Warning: 85 : BindingExpression (hash=16001149): TransferValue - using final value '3'
System.Windows.Data Warning: 86 : BindingExpression (hash=16001149): **Update - got raw value <null>**
System.Windows.Data Warning: 90 : BindingExpression (hash=16001149): **Update - using final value <null>**
System.Windows.Data Warning: 98 : BindingExpression (hash=16001149): SetValue at level 1 to LookupModelBase (hash=57292143) using ReflectPropertyDescriptor(PK): <null>
System.Windows.Data Warning: 91 : BindingExpression (hash=16001149): Got ValueChanged event from LookupModelBase (hash=57292143)
System.Windows.Data Warning: 85 : BindingExpression (hash=40869743): TransferValue - using final value ObservableCollection`1 (hash=64658589 Count=4)
所以 SelectedValue 出于某种原因设置为 null。
有人解决过这个问题吗?
谢谢
嗨,
进一步my previous post,为了比我之前的胡言乱语更清楚一点,我认为问题如下;
为什么在修改另一个属性时(由于 OnPropertyChanged)组合框显示设置为空白,即使实际基础值没有修改?如果我修改同一记录中的字段,组合框显示为空,但如果我离开并再次返回,值会返回吗?
xaml如下;
ItemsSource="{Binding TrialParentValues, Mode=OneWay}"
SelectedItem="{Binding TrialParentObj, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, Mode=TwoWay}"
DisplayMemberPath="Description"
SelectedValuePath="PK"
SelectedValue="{Binding TrialParentObj.PK}"
谢谢
【问题讨论】:
-
我已经添加了你之前帖子的链接,你能检查它是正确的吗?