C# 在列表框中显示对象属性
我想从列表框中的对象列表中显示属性“Title”:C# 在列表框中显示对象属性,c#,wpf,C#,Wpf,我想从列表框中的对象列表中显示属性“Title”: <ListBox ItemsSource="{Binding SelectableSurveysByYear}" DisplayMemberPath="{Binding Title}" SelectedItem="{Binding SelectedSurvey}"> 我的缺点在哪里?哦。。该漏洞存在于定义DisplayMemberPath中。这项工作: <ListBox Items
<ListBox ItemsSource="{Binding SelectableSurveysByYear}"
DisplayMemberPath="{Binding Title}"
SelectedItem="{Binding SelectedSurvey}">
我的缺点在哪里?哦。。该漏洞存在于定义DisplayMemberPath中。这项工作:
<ListBox ItemsSource="{Binding SelectableSurveysByYear}"
DisplayMemberPath="Title"
SelectedItem="{Binding SelectedSurvey}">
属性不支持绑定
语法。请尝试以下操作:
<ListBox ItemsSource="{Binding SelectableSurveysByYear}"
DisplayMemberPath="Title"
SelectedItem="{Binding SelectedSurvey}">
<ListBox ItemsSource="{Binding SelectableSurveysByYear}"
DisplayMemberPath="Title"
SelectedItem="{Binding SelectedSurvey}">