我认为您不能再使用 DisplayMemberPath 了。您可能需要在该组合框中创建新的数据模板。
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:local="clr-namespace:SilverlightApplication1"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<DataTemplate DataType="local:Person">
<TextBlock Text="{Binding Address}" />
</DataTemplate>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel>
<ListBox ItemsSource="{Binding Items}" />
<ListBox ItemsSource="{Binding Items}" >
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightApplication1 {
public partial class MainPage : UserControl {
public MainPage() {
this.DataContext = this;
InitializeComponent();
Items = new List<Person>{
new Person() { Name ="Name1", Address ="Address1" },
new Person() { Name ="Name2", Address ="Address2" },
new Person() { Name ="Name3", Address ="Address3" }
};
}
public IList<Person> Items { get; set; }
}
public class Person {
public string Name { get; set; }
public string Address { get; set; }
}
}