Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

BindingContext ViewCell

$
0
0

Hi,
Why BindingContext in the ViewCell is always null?
I need to put in some viewcell BoxView.
The number of BoxView depends on the BindingContext because it contains another list.
How can I do?
Thank you.

class Week() {
public string name {get;set;}
public List listDay { get;set;}
}

listView.ItemsSource = this.GetWeek();
listView.ItemTemplate = new DataTemplate(typeof(CellDay));

ViewCell:

List list = (BindingContext as Week).listDay;
foreach(Day d in list)
viewLayoutBox.Children.Add(boxView(d));
......


Viewing all articles
Browse latest Browse all 58056

Trending Articles