110,533
社区成员
发帖
与我相关
我的任务
分享
<ListBox ItemsSource="{Binding Path=PelvicFractureInfos_left[0].FingerKeys2, NotifyOnTargetUpdated=True, ValidatesOnDataErrors=True}">
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<WrapPanel Orientation="Vertical" IsItemsHost="True"/>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<Label Width="30" Content="{Binding Path=ItemGroupName}"></Label>
<Label HorizontalAlignment="Right" Width="80" Content="{Binding Path=ItemName}"></Label>
<ComboBox Width="80" ItemsSource="{Binding Path=ComboBoxKeys, NotifyOnTargetUpdated=True, ValidatesOnDataErrors=True}"
Tag="{Binding Path=PelvicFractureInfos_left[0]}"
SelectedValuePath="ItemValueInfo" DisplayMemberPath="ItemDisylayInfo" SelectionChanged="ComboBox_SelectionChanged">
</ComboBox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Diagnosis_BasedImpairmentEstimateInfo v = (sender as ComboBox).Tag as Diagnosis_BasedImpairmentEstimateInfo;
string selectvalue = (sender as ComboBox).SelectedValue.ToString();
int value = int.Parse(v.HipReplacement_TextValue.ToString());
v.SelectValue = (sender as ComboBox).SelectedValue.ToString(); //把下拉框的数值赋值给属性
Model.ComboBoxCommand_CheckTextValue.Execute(v);
}