Let's say, for instance, I have the following extremely simple window:
<Window x:Class="CalendarGenerator.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1"
Height="300"
Width="447">
<Grid>
<ListBox Margin="12,40,0,12"
Name="eventList"
HorizontalAlignment="Left"
Width="134" />
</Grid>
</Window>
And a simple list defined as:
List<String> ListOfNames = new List<String>();
And let's assume that the list has several names in it. How would I go about binding the List to the ListBox using as much code-behind as possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…