public ConversationDetails(ConversationModel conversation)
        {
            InitializeComponent();

            NameLabel.Content = conversation.Name;

            conversation.Members.ForEach(obj => MemberList.AddMemberToList(obj, conversation.ColorDictionary[obj], false));

            VisibleIdLabel.Content    = conversation.VisibleId;
            DateCreatedLabel.Content  = conversation.DateCreated.ToString("dd.MM.yyyy HH:mm");
            MessageCountLabel.Content = conversation.Messages.Count;

            CloseButton.PreviewMouseLeftButtonDown += CloseButton_PreviewMouseLeftButtonDown;
            CloseButton.MouseEnter += CloseButton_MouseEnter;
            CloseButton.MouseLeave += CloseButton_MouseLeave;
        }
Esempio n. 2
0
        private void _parent_NewconversationMembers(object sender, ConversationMembersAddedEventArgs e)
        {
            ConversationList.SelectedConversation.OnDataChanged();
            if (ConversationList.SelectedConversation.Id == e.ConversationId)
            {
                PersonModel person = _parent.Persons.Find(obj => obj.Id == e.PersonId);
                MemberList.AddMemberToList(person,
                                           ConversationList.SelectedConversation.ColorDictionary[person]);

                if (MemberList.Members.Count > 1)
                {
                    _newPhoneButton.Visibility = Visibility.Visible;

                    if (_parent.EmailClients != null && _parent.EmailClients.Any(obj => obj.ImapClient != null))
                    {
                        _newEmailButton.Visibility = Visibility.Visible;
                    }
                }
            }
        }
Esempio n. 3
0
        private void ConversationList_SelectedConversationChanged(object sender, SelectedConversationChangedEventArgs e)
        {
            SelectedConversation = e.Conversation;

            if (MessageList == null)
            {
                return;
            }

            MessageList.ClearMessages();
            MessageList.AddMessages(SelectedConversation.Messages);

            MemberList.ClearMembers();

            foreach (PersonModel member in SelectedConversation.Members)
            {
                MemberList.AddMemberToList(member, SelectedConversation.ColorDictionary[member]);
            }

            MessageListContainer.ScrollToBottom();
            MemberList.Visibility = Visibility.Visible;

            if (_newEmailButton != null)
            {
                if (MemberList.Members.Count == 1)
                {
                    _newEmailButton.Visibility = Visibility.Collapsed;
                    _newPhoneButton.Visibility = Visibility.Collapsed;
                }
                else
                {
                    if (_parent.EmailClients != null && _parent.EmailClients.Any(obj => obj.ImapClient != null))
                    {
                        _newEmailButton.Visibility = Visibility.Visible;
                    }

                    _newPhoneButton.Visibility = Visibility.Visible;
                }
            }
        }