void InitializeReverseValues() { //scrollView.Hidden = true; //activityIndicator.Hidden = false; //var timer = new System.Timers.Timer(); //timer.Interval = 50; //timer.Elapsed += delegate //{ //timer.Stop(); //timer.Dispose(); InvokeOnMainThread(async() => { CountryTextField.Text = null; RegionTextField.Text = null; CityTextField.Text = null; DetailAddressTextField.Text = null; //IndexTextField.Text = null; //NotationTextField.Text = null; if (!String.IsNullOrEmpty(countryTemp)) { CountryTextField.FloatLabelTop(); CountryTextField.Text = countryTemp; } if (!String.IsNullOrEmpty(cityTemp)) { CityTextField.FloatLabelTop(); CityTextField.Text = cityTemp; } if (!String.IsNullOrEmpty(regionTemp)) { RegionTextField.FloatLabelTop(); RegionTextField.Text = regionTemp; } if (!String.IsNullOrEmpty(indexTemp)) { IndexTextField.FloatLabelTop(); IndexTextField.Text = indexTemp; } if (!String.IsNullOrEmpty(FullCompanyAddressTemp)) { DetailAddressTextField.FloatLabelTop(); DetailAddressTextField.Text = FullCompanyAddressTemp; } UIApplication.SharedApplication.KeyWindow.EndEditing(true); CoordsTextField.UserInteractionEnabled = false; //await Task.Delay(300); SetScrollViewContentSize(); scrollView.Hidden = false; activityIndicator.Hidden = true; }); //}; //timer.Start(); }
private void FillFields() { if (!String.IsNullOrEmpty(FullCompanyAddressTemp) && FullCompanyAddressTemp != " " && !String.IsNullOrEmpty(cityTemp)) { if (FullCompanyAddressTemp.Contains(cityTemp)) { var str = FullCompanyAddressTemp.Substring(0, cityTemp.Length); if (str == cityTemp) { FullCompanyAddressTemp = FullCompanyAddressTemp.Remove(0, cityTemp.Length + 1); } } } else { FullCompanyAddressTemp = null; } var timer = new System.Timers.Timer(); timer.Interval = 50; timer.Elapsed += delegate { timer.Stop(); timer.Dispose(); InvokeOnMainThread(async() => { if (!String.IsNullOrEmpty(country)) { CountryTextField.FloatLabelTop(); CountryTextField.Text = country; } if (!String.IsNullOrEmpty(city)) { CityTextField.FloatLabelTop(); CityTextField.Text = city; } if (!String.IsNullOrEmpty(region)) { RegionTextField.FloatLabelTop(); RegionTextField.Text = region; } if (!String.IsNullOrEmpty(index)) { IndexTextField.FloatLabelTop(); IndexTextField.Text = index; } if (!String.IsNullOrEmpty(FullCompanyAddressStatic)) { DetailAddressTextField.FloatLabelTop(); DetailAddressTextField.Text = FullCompanyAddressStatic; } if (!String.IsNullOrEmpty(notation)) { NotationTextField.FloatLabelTop(); NotationTextField.Text = notation; if (!String.IsNullOrEmpty(notationTemp)) { NotationTextField.Text = notationTemp; } } CoordsTextField.UserInteractionEnabled = true; if (!String.IsNullOrEmpty(CompanyAddressMapViewController.company_lat) && !String.IsNullOrEmpty(CompanyAddressMapViewController.company_lng)) { CoordsTextField.FloatLabelTop(); CoordsTextField.Text = "N" + CompanyAddressMapViewController.company_lat + " E" + CompanyAddressMapViewController.company_lng; } CoordsTextField.UserInteractionEnabled = false; UIApplication.SharedApplication.KeyWindow.EndEditing(true); //await Task.Delay(300); SetScrollViewContentSize(); view_in_scroll.Frame = new Rectangle(0, 0 /*Convert.ToInt32(headerView.Frame.Y + headerView.Frame.Height*1.2)*/, Convert.ToInt32(View.Frame.Width), Convert.ToInt32(applyAddressBn.Frame.Y + applyAddressBn.Frame.Height)); scrollView.Hidden = false; activityIndicator.Hidden = true; if (came_from_map) { addressChangeRequest(); } }); }; timer.Start(); }