コード例 #1
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;
                }
            }
        }