50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
|
|
namespace Päevaküsimus.Models
|
|
{
|
|
[Serializable()]
|
|
public class Answer : NotificationBase, ICloneable
|
|
{
|
|
private string _answer;
|
|
public string answer {
|
|
get { return _answer; }
|
|
set
|
|
{
|
|
_answer = value;
|
|
NotifyPropertyChanged();
|
|
}
|
|
}
|
|
public bool correct { get; set; }
|
|
private int _selectionCount;
|
|
|
|
public int selectionCount
|
|
{
|
|
get { return _selectionCount; }
|
|
set
|
|
{
|
|
_selectionCount = value;
|
|
NotifyPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public Answer(string answer)
|
|
{
|
|
this.answer = answer;
|
|
this.correct = false;
|
|
}
|
|
|
|
public Answer(string answer, bool correct)
|
|
{
|
|
this.answer = answer;
|
|
this.correct = correct;
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
var c = new Answer(answer.Clone() as string, correct);
|
|
c.selectionCount = selectionCount;
|
|
return c;
|
|
}
|
|
}
|
|
} |