Exemplo n.º 1
0
 public void GetClub(Club club)
 {
     clubTotal += 1;
     if (clubTotal == countClub)
     {
         // Hủy delegate
         Helper.Instance().GetClubAck -= GetClub;
     }
     if (Helper.Instance().MyAccount != null)
     {
         if (club.AdminID == Helper.Instance().MyAccount.Number_Id)
         {
             ChallengeAction.SetGetChallenge(Helper.Instance().MyAccount.Number_Id, club.ClubID);
         }
     }
 }
Exemplo n.º 2
0
        protected override void OnAppearing()
        {
            if (Application.Current.MainPage is MasterDetailPage masterDetailPage)
            {
                masterDetailPage.IsGestureEnabled = true;
            }
            else if (Application.Current.MainPage is NavigationPage navigationPage && navigationPage.CurrentPage is MasterDetailPage nestedMasterDetail)
            {
                nestedMasterDetail.IsGestureEnabled = true;
            }
            base.OnAppearing();
            UpdateUnReadCount(AppChat.Helpers.Helper.Instiance().UnReadMsg);
            // Update lại số lượng tin nhắn chưa đọc
            AppChat.Helpers.Helper.Instiance().NotifyAcceptOrCancelAddFrd += ResponseAccept;
            isUpadate = true;
            if (model == null)
            {
                model = BindingContext as PersonalPageViewModel;
            }
            model.personalPage = this;

            if (!isFirst)
            {
                AppChat.Services.Service.Instiance().inPage = 1;
                Helper.Instance().objMyClub = this;
                Helper.Instance().GetMyClub(Helper.Instance().MyAccount.Number_Id);
                // Gửi yêu cầu lấy số lượng thách đấu
                ChallengeAction.SetGetChallenge(Helper.Instance().MyAccount.Number_Id, 0);
                // Đăng ký delegate để lấy danh sách ClubId
                //  Helper.Instance().GetClubIdAck += GetClubId;
                //  Helper.Instance().GetClubAck += GetClub;
                // Helper.Instance().CheckExistClubMyClubId(Helper.Instance().MyAccount.Number_Id);
                isFirst = true;
            }
            Device.StartTimer(TimeSpan.FromMilliseconds(1000), () =>
            {
                UpdateNotify();
                return(false);
            });
        }