private void UpdateStatus(object sender, PropertyChangedEventArgs e)
        {
            _profile = MyProfileEdditor.ChangeStatus(_profile, _connection.StatusUpdate.Key,
                                                     _connection.StatusUpdate.Value);


            ContaktsListPresenter.GetContaktsViewModel(_profile.MyContacts, _mainWindow);


            _mainWindow.ChangeStatusContact(_connection.StatusUpdate.Key);
        }
        private void AddNewContact(Contact contact)
        {
            if (_profile.MyName == contact.Name || _profile.MyContacts.Contains(contact) || _mainWindow.ContaktsMessageHistory.ContainsKey(contact.Name))
            {
                return;
            }

            _profile.MyContacts.Add(contact);

            _mainWindow.ContaktsMessageHistory.Add(contact.Name, contact.MessageHistory);
            ContaktsListPresenter.GetContaktsViewModel(_profile.MyContacts, _mainWindow);
        }
        private void LoadProfile(object sender, EventArgs eventArgs)
        {
            _profile = _connection.LogIn(_nameWindow.Name) ?? new MyProfile
            {
                MyName = _nameWindow.Name
            };


            if (_profile.MyContacts == null)
            {
                _profile.MyContacts = new List <Contact>();
            }

            ContaktsListPresenter.FillContactsMessages(_profile.MyContacts, _mainWindow);

            ContaktsListPresenter.GetContaktsViewModel(_profile.MyContacts, _mainWindow);
        }