using System;

using Windows.UI.Xaml.Data;
//using System.ComponentModel;

namespace Flashcard.Models {

    public class Answer : INotifyPropertyChanged {

        public bool IsCorrect { get; set; }
        public int SortIndex { get; set; }
        public string Text { get; set; }
        private AnswerStatus _status;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void RaisePropertyChanged(string propertyName) {
            var handler = PropertyChanged;
            if (handler != null) {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public void Initialize(string text) {
            this.Text = text;
            this.IsCorrect = false;
            this.SortIndex = Question.Random.Next(1000);
        }

        public AnswerStatus Status {
            get { return _status; }
            set {
                if (_status != value) {
                    _status = value;
                    RaisePropertyChanged("Status");
                }
            }
        }

    }

    public enum AnswerStatus {
        Normal,
        Correct,
        Incorrect
    }
}
