public KnockoutMatchView() { BindingContext = new KnockoutMatchesViewModel(); var refresh = new ToolbarItem { Command = ViewModel.LoadItemsCommand, Icon = "refresh.png", Name = "refresh", Priority = 0 }; ToolbarItems.Add (refresh); var stack = new StackLayout { Orientation = StackOrientation.Vertical, Padding = new Thickness(0, 8, 0, 8) }; var listView = new ListView (); listView.ItemsSource = ViewModel.KnockoutMatches; var cell = new DataTemplate(typeof(ListTextCell)); cell.SetBinding (TextCell.TextProperty, "KnockoutMatchName"); cell.SetBinding (TextCell.DetailProperty, "KnockoutMatchTeams"); listView.ItemTemplate = cell; stack.Children.Add (listView); Content = stack; }
public KnockoutMatchView() { BindingContext = new KnockoutMatchesViewModel(); var refresh = new ToolbarItem { Command = ViewModel.LoadItemsCommand, Icon = "refresh.png", Name = "refresh", Priority = 0 }; ToolbarItems.Add(refresh); var stack = new StackLayout { Orientation = StackOrientation.Vertical, Padding = new Thickness(0, 8, 0, 8) }; var listView = new ListView(); listView.ItemsSource = ViewModel.KnockoutMatches; var cell = new DataTemplate(typeof(ListTextCell)); cell.SetBinding(TextCell.TextProperty, "KnockoutMatchName"); cell.SetBinding(TextCell.DetailProperty, "KnockoutMatchTeams"); listView.ItemTemplate = cell; stack.Children.Add(listView); Content = stack; }