Hi,
I've had a problem with a simple bit of code. When a button is clicked an activity should be added to a list of activities. The code is below, I don't understand why it does not add it when it is so simple, i'm probably missing something very obvious?? Thanks in advance
`namespace serialiser
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
public void Serialiser(object sender, EventArgs args)
{
SelfCare selfCare = new SelfCare();
// add activities
var myActivity1 = new Activity()
{
Category = "Fitness",
ActivityDescription = "Boxing class",
};
selfCare.Activities.Add(myActivity1);
}
public class SelfCare
{
public List<Activity> Activities { get; set; }
public SelfCare()
{
Activities = new List<Activity>();
}
}
public class Activity
{
public String ActivityDescription { get; set; }
public String Category { get; set; }
}
}
}
`