有没有办法将代码的C#部分中创建的数组绑定到ListBox,以便在设计时显示?将数组绑定到列表框,以便在运行时出现
喜欢的东西
XAML
<ListBox ItemsSource="{Binding MyStrings}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBox Text={Binding} />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
C#
public string[] MyStrings = new string[] {"A", "B", "C"};