public XFListViewPage1() { var classNames = new[] { "Building Cross Platform Apps with Xamarin Part 1", "Building Cross Platform Apps with Xamarin Part 2", "Building Google Glass Apps with c# and Xamarin", "Android for .NET Developers" }; Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0); var listView = new ListView { //listView.ItemsSource = classNames; //listView.ItemsSource = // from c in classNames // where c.StartsWith("Building") // select c; ItemsSource = PluralsightCourse.GetCourseList() }; listView.ItemSelected += (sender, e) => { if (e.SelectedItem != null) { Debug.WriteLine("Selected: " + e.SelectedItem); listView.SelectedItem = null; } }; Content = listView; }
public XFListViewPage2() { var classNames = new[] { "Building Cross Platform Apps with Xamarin Part 1", "Building Cross Platform Apps with Xamarin Part 2", "Building Google Glass Apps with c# and Xamarin", "Android for .NET Developers" }; Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0); var listView = new ListView(); //listView.ItemsSource = classNames; listView.ItemsSource = PluralsightCourse.GetCourseList(); var cell = new DataTemplate(typeof(TextCell)); //cell.SetBinding(TextCell.TextProperty, new Binding(".")); cell.SetBinding(TextCell.TextProperty, new Binding("Title")); cell.SetBinding(TextCell.DetailProperty, new Binding("Author")); cell.SetValue(TextCell.TextColorProperty, Color.Red); cell.SetValue(TextCell.DetailColorProperty, Color.Yellow); listView.ItemTemplate = cell; Content = listView; }
public XFListViewPage3() { Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0); var listView = new ListView(); listView.ItemsSource = PluralsightCourse.GetCourseList(); listView.ItemTemplate = new DataTemplate(typeof(CourseCell)); Content = listView; }