public FriendViewModel(int friendNumber)
        {
            FriendNumber = friendNumber;

            Conversation = new ConversationViewModel(this);
            FileTransfers = new FileTransfersViewModel(friendNumber);
            RecentMessages = new RecentMessagesPerUserViewModel(friendNumber);
            Call = new CallViewModel(friendNumber);

            Name = ToxModel.Instance.GetFriendName(friendNumber);
            if (Name == String.Empty)
            {
                Name = ToxModel.Instance.GetFriendPublicKey(friendNumber).ToString().Substring(0, 10);
            }

            StatusMessage = ToxModel.Instance.GetFriendStatusMessage(friendNumber);
            if (StatusMessage == String.Empty)
            {
                StatusMessage = "Friend request sent.";
            }

            SetFriendStatus(ToxModel.Instance.GetFriendStatus(friendNumber));
            IsConnected = ToxModel.Instance.IsFriendOnline(friendNumber);

            AvatarManager.Instance.FriendAvatarChanged += FriendAvatarChangedHandler;

            ToxModel.Instance.FriendNameChanged += FriendNameChangedHandler;
            ToxModel.Instance.FriendStatusMessageChanged += FriendStatusMessageChangedHandler;
            ToxModel.Instance.FriendStatusChanged += FriendStatusChangedHandler;
            ToxModel.Instance.FriendConnectionStatusChanged += FriendConnectionStatusChangedHandler;
        }
Exemple #2
0
 public ScrollManager(ListView messagesListView, ConversationViewModel conversationViewModel,
     Grid messageAddedNotificationGrid, Storyboard messageAddedNotificationAnimation)
 {
     _messagesListView = messagesListView;
     _conversationViewModel = conversationViewModel;
     _messageAddedNotificationGrid = messageAddedNotificationGrid;
     _messageAddedNotificationAnimation = messageAddedNotificationAnimation;
 }