public async void Init() { await Task.WhenAll(viewModel.LoadNewestBuyOrRentList(), viewModel.GetCompany()); if (UserLogged.RoleId == 0) { await viewModel.LoadContactNeeds(); StackTitlNhuCauKhachHang.IsVisible = true; StackListNhuCauKhachHang.IsVisible = true; } if (viewModel.Company.CreatedById == Guid.Parse(UserLogged.Id)) { StackButtonGroup.IsVisible = true; } MessagingCenter.Subscribe <ViewModels.MoiGioiViewModels.AddContactNeedContentViewModel>(this, "ReloadNhuCauList", async(sender) => { await this.viewModel.LoadContactNeeds(); }); MessagingCenter.Subscribe <PostPage, Guid>(this, "OnDeleteSuccess", async(sender, PostId) => { var deletedPost = this.viewModel.NewestBuyOrRentList.SingleOrDefault(x => x.Id == PostId); if (deletedPost != null) { this.viewModel.NewestBuyOrRentList.Remove(deletedPost); } }); MessagingCenter.Subscribe <PostPage>(this, "OnSavePost", async(sender) => { await viewModel.LoadNewestBuyOrRentList(); }); MessagingCenter.Subscribe <ContactListPage, Guid>(this, "DeleteContact", async(sender, id) => { await this.viewModel.LoadContactNeeds(); }); loadingPopup.IsVisible = false; }