有沒有辦法將代碼的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"};