Last active
August 3, 2017 17:36
-
-
Save almirvuk/a6f227fbbf40524ec65d75f118427eec to your computer and use it in GitHub Desktop.
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 CarsExample.Models; | |
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace CarsExample.ViewModels { | |
public class CarsViewModel : INotifyPropertyChanged { | |
private ObservableCollection<Car> items; | |
public ObservableCollection<Car> Items { | |
get { return items; } | |
set { | |
items = value; | |
} | |
} | |
public CarsViewModel() { | |
// Here you can have your data form db or something else, | |
// some data that you already have to put in the list | |
Items = new ObservableCollection<Car>() { | |
new Car() | |
{ | |
CarID = 1, | |
Make = "Tesla Model S", | |
YearOfModel = 2015 | |
}, | |
new Car() | |
{ | |
CarID = 2, | |
Make = "Audi R8", | |
YearOfModel = 2012 | |
}, | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment