Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created December 26, 2017 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/544db44a82f217e64464358e11f1339c to your computer and use it in GitHub Desktop.
Save jfversluis/544db44a82f217e64464358e11f1339c to your computer and use it in GitHub Desktop.
The code-behind of the page
using System.Collections.ObjectModel;
using GroupingListViewSample.Models;
using GroupingListViewSample.ViewModels;
using Xamarin.Forms;
namespace GroupingListViewSample
{
public partial class GroupingListViewSamplePage : ContentPage
{
public ObservableCollection<PhoneGroup> PhonesList { get; set; } = new ObservableCollection<PhoneGroup>();
public GroupingListViewSamplePage()
{
InitializeComponent();
PhonesList.Add(new PhoneGroup("Apple", new[]{ new Phone
{
Title = "iPhone 6s",
Price = 50000
},
new Phone
{
Title = "iPhone 7",
Price = 38000
}}));
PhonesList.Add(new PhoneGroup("Huawei", new[]{ new Phone
{
Title = "Huawei P10",
Price = 10000
},
new Phone
{
Title = "Huawei Mate 8",
Price = 29000
}}));
PhonesList.Add(new PhoneGroup("Samsung", new[]{ new Phone
{
Title = "Galaxy S8",
Price = 60000
},
new Phone
{
Title = "Galaxy S7 Edge",
Price = 50000
}}));
BindingContext = this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment