0
我已經一些代碼,得到BindingExpression.UpdateSource()拋出指定轉換無效
bindingExpression = ((ComboBox)(((Grid)(control.Content)).Children[0])).GetBindingExpression(ComboBox.SelectedValueProperty);
組合框是在XAML
<ComboBox Style="{StaticResource UiEditorComboBoxStyle}"
Name="comboBox_Business"
DisplayMemberPath="Value.Name"
SelectedValuePath="Value.BusinessId"
>
<ComboBox.SelectedValue>
<Binding Path="entity.BusinessId" UpdateSourceTrigger="Explicit" ValidatesOnDataErrors="True" ValidatesOnExceptions="True" Mode="TwoWay">
<Binding.ValidationRules>
<validators:ValidationRule_SelectedItem NotSelectedErrorMessage="A Business must be selected"
NotSelectedErrorMessageTranslationKey="BusinessMustBeSelected" />
</Binding.ValidationRules>
</Binding>
</ComboBox.SelectedValue>
</ComboBox>
限定的組合框的結合表達當我打電話
bindingExpression.UpdateSource()
我得到一個「指定強制轉換無效」的異常。我猜這是與財產類型(Guid)有關,但我無法弄清楚如何處理它。
組合框的值綁定到詞典
任何指針?
歡呼聲,
Ĵ