开发者

silverlight Label using PropertyPath

Using silverlight 4, I've set the target of a label to a combobox. The combobox has two bindings set, and its using the wrong one to get the label's contents.

I know I'm supposed to use the Label's PropertyPath property to tell it wich binding to use, but I can't find any examples of what to write as the value. My instinct is to use the name of the combo box's property, but that doesn't seem to work.

Removing the second binding will work, but I need both bindings. Can anyone help me with this?

[Display(Name = "Manufacturer"))]
public List<dms_Manufacturer> ManufacturerList {get;set;}


<sdk:Label Grid.Row ="4" Grid.Column="0"  
    Target="{Binding ElementName=cmb_Manufacturer}开发者_StackOverflow中文版"
    PropertyPath="ItemsSource"  />
<ComboBox Grid.Row ="4" Grid.Column="2" x:Name="cmb_Manufacturer" 
    ItemsSource="{Binding ManufacturerList}" 
    DisplayMemberPath="Name"
    SelectedItem="{Binding dms_Manufacturer, Mode=TwoWay}"
    SelectionChanged="cmb_Manufacturer_SelectionChanged"  />


Try:

<sdk:Label Grid.Row ="4" Grid.Column="0"
       Target="{Binding ElementName=cmb_Manufacturer}" 
       PropertyPath="ManufacturerList"  /> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜