Exemplo n.º 1
0
        private void ContactsClick(object sender, EventArgs e)
        {
            ViewContacts contactsView = new ViewContacts();

            contactsView.Activate();
            contactsView.ShowDialog();
        }
Exemplo n.º 2
0
        public void AppendInterlocutor(Interlocutor interlocutor)
        {
            if (ViewContacts.Any(contact => contact.Interlocutor == interlocutor))
            {
                SelectedInterlocutor = ViewContacts.Single(contact => contact.Interlocutor == interlocutor);
                return;
            }
            var interlocutorModel = new InterlocutorChatViewModel(interlocutor, _core.ModelContext);

            ViewContacts.Add(interlocutorModel);
            SelectedInterlocutor = interlocutorModel;
            interlocutor.SubscribeToChange(() => interlocutor.HasUnreadMessages, sender =>
            {
                if (SelectedInterlocutor != null && SelectedInterlocutor.Interlocutor == sender &&
                    sender.HasUnreadMessages)
                {
                    sender.HasUnreadMessages = false;
                }
            });
        }
Exemplo n.º 3
0
 protected void CloseInterlocutorTabExecuted(InterlocutorChatViewModel interlocutorModel)
 {
     ViewContacts.Remove(interlocutorModel);
     SelectedInterlocutor = ViewContacts.FirstOrDefault();
 }