void removeCoordsQuestion() { if (!String.IsNullOrEmpty(CoordsTextField.Text)) { var option = UIAlertController.Create("Удалить координаты?", null, UIAlertControllerStyle.ActionSheet); option.AddAction(UIAlertAction.Create("Удалить", UIAlertActionStyle.Default, (action) => { CompanyAddressMapViewController.lat = null; CompanyAddressMapViewController.lng = null; CompanyAddressMapViewController.company_lat = null; CompanyAddressMapViewController.company_lng = null; //CoordsTextField.UserInteractionEnabled = true; CoordsTextField.Text = null; CoordsTextField.FloatLabelBack(); //CoordsTextField.UserInteractionEnabled = false; })); option.AddAction(UIAlertAction.Create("Отмена", UIAlertActionStyle.Cancel, null)); this.PresentViewController(option, true, null); } else { var option = UIAlertController.Create("Выберите координаты на карте", null, UIAlertControllerStyle.ActionSheet); option.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Cancel, null)); this.PresentViewController(option, true, null); } }
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(); }