Don't bind it to a list, bind instead to an ObservableCollection<MyTask>
. You're populating the list AFTER the GridView has bound to it, so the GridView doesn't know it changed. If you're not populating it and instead simply setting it, you'll need to implement INotifyPropertyChanged
.
Secondly, what you're essentially doing is setting the source to your list, then trying to add a TextBlock
also as a source (and being ignored). What you're looking for instead is to set the ItemTemplate
. Something like:
<GridView.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding TaskName}"/>
</DataTemplate>
</GridView.ItemTemplate>
See the documentation for more information.