public void Find(string query)
        {
            var chat = _chat;

            if (chat == null)
            {
                return;
            }

            if (chat.Type is ChatTypeSupergroup supergroup)
            {
                Search = new ChatMemberCollection(ProtoService, supergroup.SupergroupId, _find(query));
            }
            else if (chat.Type is ChatTypeBasicGroup basicGroup)
            {
                var filter = default(ChatMembersFilter);
                switch (_filter)
                {
                case SupergroupMembersFilterAdministrators administrators:
                    filter = new ChatMembersFilterAdministrators();
                    break;

                case SupergroupMembersFilterBanned banned:
                    filter = new ChatMembersFilterBanned();
                    break;

                case SupergroupMembersFilterBots bots:
                    filter = new ChatMembersFilterBots();
                    break;

                case SupergroupMembersFilterRecent recent:
                    filter = null;
                    break;

                case SupergroupMembersFilterRestricted restricted:
                    filter = new ChatMembersFilterRestricted();
                    break;

                case SupergroupMembersFilterSearch search:
                    filter = null;
                    break;
                }

                Search = new ChatMemberCollection(ProtoService, chat.Id, query, filter);
            }
        }
        public override Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            var chatId = (long)parameter;

            Chat = ProtoService.GetChat(chatId);

            var chat = _chat;

            if (chat == null)
            {
                return(Task.CompletedTask);
            }

            if (chat.Type is ChatTypeSupergroup supergroup)
            {
                var item  = ProtoService.GetSupergroup(supergroup.SupergroupId);
                var cache = ProtoService.GetSupergroupFull(supergroup.SupergroupId);

                Delegate?.UpdateSupergroup(chat, item);

                if (cache == null)
                {
                    ProtoService.Send(new GetSupergroupFullInfo(supergroup.SupergroupId));
                }
                else
                {
                    Delegate?.UpdateSupergroupFullInfo(chat, item, cache);
                }

                Members = new ChatMemberCollection(ProtoService, supergroup.SupergroupId, _filter ?? _find(string.Empty));
            }
            else if (chat.Type is ChatTypeBasicGroup basicGroup)
            {
                var item = ProtoService.GetBasicGroup(basicGroup.BasicGroupId);

                if (Delegate is IBasicGroupDelegate basicDelegate)
                {
                    basicDelegate.UpdateBasicGroup(chat, item);
                }

                var filter = default(ChatMembersFilter);
                switch (_filter)
                {
                case SupergroupMembersFilterAdministrators administrators:
                    filter = new ChatMembersFilterAdministrators();
                    break;

                case SupergroupMembersFilterBanned banned:
                    filter = new ChatMembersFilterBanned();
                    break;

                case SupergroupMembersFilterBots bots:
                    filter = new ChatMembersFilterBots();
                    break;

                case SupergroupMembersFilterRecent recent:
                    filter = null;
                    break;

                case SupergroupMembersFilterRestricted restricted:
                    filter = new ChatMembersFilterRestricted();
                    break;

                case SupergroupMembersFilterSearch search:
                    filter = null;
                    break;
                }

                Members = new ChatMemberCollection(ProtoService, chat.Id, string.Empty, filter);
            }

            return(Task.CompletedTask);
        }