async void AdRGButton_TouchUpInside(object sender, EventArgs e) { Ad ad = new Ad(); if (sender == Ad1RGButton) { ad = DataObject.Ads[2]; } if (Reachability.IsHostReachable(Settings._baseDomain)) { SpecResponse specResponse = new SpecResponse(); var specification = await specResponse.GetSpecBySpecIDDesignationIDAsync(ad.SpecId, ad.DesignationId); if (specification.SpecId != 0) { MapViewController mapViewController = (MapViewController)Storyboard.InstantiateViewController("MapViewController"); mapViewController.SpecFieldList = specification.SpecFieldDictionary[SpecTableViewSource._rangeSection]; ShowDetailViewController(mapViewController, this); } } else { HelperMethods.SendBasicAlert("Connect to a Network", Settings._networkProblemMessage); } }
public override UIView GetViewForHeader(UITableView tableView, nint section) { var headerWidth = tableView.Frame.Width; var headerHeight = 25; var labelLeftMargin = 20; UIView containerView = new UIView(new CoreGraphics.CGRect(0, 0, headerWidth, headerHeight)); var textColor = UIColor.FromRGB(50, 205, 50); var font = UIFont.BoldSystemFontOfSize(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ?24:16); var sectionName = keys[section]; if (sectionName != _rangeSection) { UILabel headerLabel = new UILabel(new CoreGraphics.CGRect(labelLeftMargin, 0, headerWidth - labelLeftMargin, headerHeight)); // Set the frame size you need headerLabel.TextColor = textColor; // Set your color headerLabel.Text = sectionName; headerLabel.Font = font; containerView.AddSubview(headerLabel); } else { UIButton button = new UIButton(new CoreGraphics.CGRect(labelLeftMargin, 0, headerWidth - labelLeftMargin, headerHeight)); button.SetTitle(sectionName, UIControlState.Normal); button.SetTitleColor(textColor, UIControlState.Normal); button.Font = font; button.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; //button.SetImage(UIImage.FromBundle("map.png"), UIControlState.Normal); button.TouchUpInside += (sender, e) => { if (Reachability.IsHostReachable(Settings._baseDomain)) { //var specSection = SpecDictionary.Where(row => row MapViewController mapViewController = (MapViewController)Owner.Storyboard.InstantiateViewController("MapViewController"); mapViewController.SpecFieldList = SpecDictionary[_rangeSection]; Owner.ShowDetailViewController(mapViewController, this); } else { HelperMethods.SendBasicAlert("Connect to a Network", Settings._networkProblemMessage); } }; containerView.AddSubview(button); } return(containerView); }
//public override UIView GetViewForHeader(UITableView tableView, int section) //{ //} public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { //var cell = tableView.CellAt(indexPath); var section = keys[indexPath.Section]; if (section == _rangeSection) { if (Reachability.IsHostReachable(Settings._baseDomain)) { var specSection = SpecDictionary[keys[indexPath.Section]]; MapViewController mapViewController = (MapViewController)Owner.Storyboard.InstantiateViewController("MapViewController"); mapViewController.SpecFieldList = specSection; Owner.ShowDetailViewController(mapViewController, this); } else { HelperMethods.SendBasicAlert("Connect to a Network", Settings._networkProblemMessage); } } tableView.DeselectRow(indexPath, true); }