コード例 #1
0
ファイル: ContactsViewModel.cs プロジェクト: Fart03/lau
        public void Handle(TLUpdateContactLink update)
        {
            Execute.BeginOnUIThread(() =>
            {
                var contact = update.MyLink is TLContactLinkContact;
                var already = Items.FirstOrDefault(x => x.Id == update.UserId);
                if (already == null)
                {
                    if (contact)
                    {
                        var user = CacheService.GetUser(update.UserId) as TLUser;
                        if (user != null)
                        {
                            Items.Add(user);
                        }
                    }
                    return;
                }

                if (contact)
                {
                    Items.Add(already);
                    return;
                }

                Items.Remove(already);
            });
        }
コード例 #2
0
        public void Handle(TLUpdateContactLink update)
        {
            if (With is TLUser user && user.Id == update.UserId)
            {
                Execute.BeginOnUIThread(() =>
                {
                    IsShareContactAvailable = user.HasAccessHash && !user.HasPhone && !user.IsSelf && !user.IsContact && !user.IsMutualContact;
                    IsAddContactAvailable   = user.HasAccessHash && user.HasPhone && !user.IsSelf && !user.IsContact && !user.IsMutualContact;

                    RaisePropertyChanged(() => With);

                    //this.Subtitle = this.GetSubtitle();
                    //base.NotifyOfPropertyChange<TLObject>(() => this.With);
                    //this.ChangeUserAction();
                });
            }
        }