using System; using System.Collections; using System.Collections.ObjectModel; namespace Päevaküsimus.Models { [Serializable()] public class Question : NotificationBase, ICloneable { private string _question; public string question { get { return _question; } set { _question = value; NotifyPropertyChanged(); } } private ObservableCollection _answers; public ObservableCollection answers { get { return _answers; } } public Question(string question) { this.question = question; this._answers = new ObservableCollection(); } public void AddAnswer(Answer answer) { _answers.Add(answer); } public object Clone() { var q = new Question(_question.Clone() as string); foreach (var answer in _answers) { q.AddAnswer(answer.Clone() as Answer); } return q; } } }