1 回答

TA贡献1111条经验 获得超0个赞
您必须使用 aListBox.ItemTemplate以便您可以在ListBox.
由于您希望能够选择文本等,最好的选择是使用TextBox.
<ListBox Grid.Row="0" Name="uiOCRData">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=.}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
编辑
假设您想绑定到一些类对象的列表而不是简单的字符串列表。假设你的类看起来像这样:
public class Data
{
public int Id { get; set; }
public string Name { get; set; }
}
然后你可以Properties像这样绑定到类中的任何一个:
<ListBox Grid.Row="0" Name="uiOCRData">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBox Width="100" Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
- 1 回答
- 0 关注
- 366 浏览
添加回答
举报