Created
December 26, 2017 21:27
-
-
Save jfversluis/544db44a82f217e64464358e11f1339c to your computer and use it in GitHub Desktop.
The code-behind of the page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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