在下面的 XAML 中,组合框不可见。我究竟做错了什么?
<Grid>
<StackPanel>
<ComboBox Name="combo1"
ItemsSource="{Binding}"
DisplayMemberPath="PartNumber" />
</StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0"
Grid.Column="0"
Text="{Binding ElementName=combo1, Path=SelectedItem.PartName}"
Background="AliceBlue" />
<TextBlock Grid.Row="0"
Grid.Column="1"
Text="{Binding ElementName=combo1, Path=SelectedItem.PartQuantity}"
Background="Beige" />
</Grid>
</Grid>