public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(null); } short id = (short)value; LoaiCongTyModel loaiCongTyModel = LoaiCongTyData.GetById(id); return(loaiCongTyModel.Name); }
async void Inti() { await viewModel.LoadData(); if (UserLogged.IsLogged && !string.IsNullOrWhiteSpace(UserLogged.CompanyId)) { stAddCompany.IsVisible = false; } MessagingCenter.Subscribe <AddCompanyPage, Guid>(this, "OnDeleteSuccess", async(sender, CompanyId) => { loadingPopup.IsVisible = true; if (this.viewModel.Data.Any(x => x.Id == CompanyId)) { var deleteCompany = this.viewModel.Data.Single(x => x.Id == CompanyId); this.viewModel.Data.Remove(deleteCompany); } loadingPopup.IsVisible = false; }); MessagingCenter.Subscribe <AddCompanyPage>(this, "OnSaveCompany", async(sender) => { this.viewModel.RefreshCommand.Execute(null); stAddCompany.IsVisible = false; }); List <LoaiCongTyModel> listLoaiCongTyModel = new List <LoaiCongTyModel>(LoaiCongTyData.GetListNganhNghe()); List <LoaiCongTyModel> newListLoaiCongTyModel = new List <LoaiCongTyModel>(); newListLoaiCongTyModel.Add(new LoaiCongTyModel(-1, Language.tat_ca)); foreach (var item in listLoaiCongTyModel) { newListLoaiCongTyModel.Add(item); } BindableLayout.SetItemsSource(stListLoaiCongty, newListLoaiCongTyModel); //set mau cho filter "Tat ca" var radBorder = stListLoaiCongty.Children[0] as RadBorder; radBorder.BackgroundColor = (Color)App.Current.Resources["MainDarkColor"]; (radBorder.Content as Label).TextColor = Color.White; loadingPopup.IsVisible = false; }