Note that there are some explanatory texts on larger screens.

plurals
  1. PONo binding error but still binding does not show anything?
    primarykey
    data
    text
    <p>What do I have to change in my xaml/code to make the binding to the <code>properties =&gt; SchoolclassName and LessonName</code> to work on both <code>TextBlock</code>s? I get no Binding errors but I do not see anything displayed:</p> <pre><code>&lt;Grid Margin="20" Height="300" Background="AliceBlue"&gt; &lt;ListView ItemsSource="{Binding Timetable}"&gt; &lt;ListView.View&gt; &lt;GridView&gt; &lt;GridView.Columns&gt; &lt;GridViewColumn Header="Period" DisplayMemberBinding="{Binding LessonPeriod}"/&gt; &lt;GridViewColumn Header="Monday"&gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;ListView ItemsSource="{Binding Monday}"&gt; &lt;ListView.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel Width="150" Orientation="Horizontal"&gt; &lt;TextBlock Text="{Binding LessonName}"/&gt; &lt;TextBlock Text=" "/&gt; &lt;TextBlock Text="{Binding SchoolclassName}"/&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/ListView.ItemTemplate&gt; &lt;/ListView&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;/GridView.Columns&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; &lt;/Grid&gt; public partial class Window1 : Window { List&lt;TimetableEntry&gt; _timetable = new List&lt;TimetableEntry&gt;(); public List&lt;TimetableEntry&gt; Timetable { get { return _timetable; } set { _timetable = value; } public Window1() { InitializeComponent(); _timetable.Add(new TimetableEntry() { LessonPeriod = "Period 1", Monday = new TimetableDay() { LessonName = "Maths" , SchoolclassName = "1c", }, } ); this.DataContext = this; } public class TimetableEntry { public string LessonPeriod { get; set; } public TimetableDay Monday { get; set; } public TimetableDay Tuesday { get; set; } public TimetableDay Wednesday { get; set; } public TimetableDay Thursday { get; set; } public TimetableDay Friday { get; set; } public TimetableDay Saturday { get; set; } public TimetableDay Sunday { get; set; } } public class TimetableDay { public string LessonName { get; set; } public string SchoolclassName { get; set; } } public class TimetableLesson { public string LessonName { get; set; } public string SchoolclassName { get; set; } public DateTime LessonTime { get; set; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload