我正在尝试将文本块绑定到可观察集合中的项目。下面是集合的类和属性。我是否正确绑定?谢谢!
public class ListStuff
{
public string Name { get; set;}
}
private ObservableCollection<ListStuff> mListStuff = new ObservableCollection<ListStuff>();
public ObservableCollection<ListStuff> NameLists
{
get
{
return mListStuff;
}
}
这是 Xaml,如果我绑定到它说的 NameLists(集合)
<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" BorderThickness="0"
<TextBlock Margin="0,5" FontSize="24" HorizontalAlignment="Stretch" Text="{Binding Path=Name"}/>
</Border>