using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.ConversationalUI;

namespace chatSimplified
{
    class MainViewModel: ViewModelBase
    {
        //I am maintining two observable collections, one for each chat for some purposes in my code that are not shown in this simplified version
        public ObservableCollection<TextMessageObject> Chat1Messages { get; set; }
        public ObservableCollection<TextMessageObject> Chat2Messages { get; set; }

        public Author FirstAuthor { get; set; }
        public Author SecondAuthor { get; set; }
        //private Author chat1CurrentAuthor;
        //private Author chat2CurrentAuthor;

        public MainViewModel()
        {
            this.Chat1Messages = new ObservableCollection<TextMessageObject>();
            this.Chat2Messages = new ObservableCollection<TextMessageObject>();

            this.FirstAuthor = new Author("user1");
            this.SecondAuthor = new Author("user2");
                                
            //this.chat1CurrentAuthor = this.FirstAuthor;
            //this.chat2CurrentAuthor = this.SecondAuthor;

            this.Chat1Messages.Add(new TextMessageObject() { Text = "Hi", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });
            this.Chat2Messages.Add(new TextMessageObject() { Text = "Hi", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });

            this.Chat1Messages.Add(new TextMessageObject() { Text = "Hello", MsgAuthor = this.SecondAuthor, CreationDate = DateTime.Now });
            this.Chat2Messages.Add(new TextMessageObject() { Text = "Hello", MsgAuthor = this.SecondAuthor, CreationDate = DateTime.Now });

            this.Chat1Messages.Add(new TextMessageObject() { Text = "How are you?", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });
            this.Chat2Messages.Add(new TextMessageObject() { Text = "How are you?", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });

            this.Chat1Messages.Add(new TextMessageObject() { Text = "I'm Good, you?", MsgAuthor = this.SecondAuthor, CreationDate = DateTime.Now });
            this.Chat2Messages.Add(new TextMessageObject() { Text = "I'm Good, you?", MsgAuthor = this.SecondAuthor, CreationDate = DateTime.Now });

            this.Chat1Messages.Add(new TextMessageObject() { Text = "Not bad", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });
            this.Chat2Messages.Add(new TextMessageObject() { Text = "Not bad", MsgAuthor = this.FirstAuthor, CreationDate = DateTime.Now });
        }

    }
}
