Skip to content

Instantly share code, notes, and snippets.

@roycornelissen
Last active August 29, 2015 14:18
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 roycornelissen/f43c8cd6f558f912f242 to your computer and use it in GitHub Desktop.
Save roycornelissen/f43c8cd6f558f912f242 to your computer and use it in GitHub Desktop.
Simple ViewModel class for Xamarin demos
using System;
using System.Collections.Generic;
using System.ComponentModel;
public class EventsViewModel: INotifyPropertyChanged
{
public EventsViewModel()
{
Events = new List<string> {"VSLive!", "//build", "Xamarin Evolve", "Microsoft TechDays"};
NotifyPropertyChanged("Events");
}
public IEnumerable<string> Events
{
get;
private set;
}
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment