常规绑定方式:

 

ViewModel层:  public Dictionary<string, string>MathRelationCollection{ get; set; }//属性

//赋值                          

MathRelationCollection = new Dictionary<string, string>();
MathRelationCollection = DynamicQueryHelper.GetMathCollection();

 

UI 绑定:ItemsSource="{Binding LogicRelationCollecion}" DisplayMemberPath="{Binding Key, Mode=OneWay}" SelectedValuePath="{Binding Value, Mode=OneWay}"

 

问题:前台Combobox显示为:[key,value]

 

解决方法:ItemsSource="{Binding LogicRelationCollecion}" DisplayMemberPath=“Key" SelectedValuePath="Value"

 

虽然解决了,但为什么会这样,还没想到,也欢迎大家多多提示

posted on 2012-11-06 18:01  swarb  阅读(137)  评论(0编辑  收藏  举报