public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell("PopoverSettingIdentifier"); try { if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, "PopoverSettingIdentifier"); } cell.Accessory = UITableViewCellAccessory.None; cell.SelectionStyle = UITableViewCellSelectionStyle.Default; if (indexPath.Section == 0 && indexPath.Row == 1) { cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.TextLabel.Text = "Content Sync"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/sync.png"); if (syncSwitch == null) { syncSwitch = new UISwitch(); syncSwitch.Frame = new CGRect(tableView.Frame.Size.Width - 20 - syncSwitch.Frame.Width, 22f - (syncSwitch.Frame.Height / 2f), syncSwitch.Frame.Width, syncSwitch.Frame.Height); syncSwitch.ValueChanged += (object sender, EventArgs e) => { Settings.WriteSyncOn(syncSwitch.On); if (Settings.SyncOn) { if (parent.SyncOnEvent != null) { parent.SyncOnEvent(); } } else { if (parent.SyncOffEvent != null) { parent.SyncOffEvent(); } } }; // Disable syncing for Demo server syncSwitch.SetState(Settings.SyncOn, false); if (Reachability.IsDefaultNetworkAvailable() && !URL.ServerURL.Contains(StringRef.DemoURL)) { syncSwitch.Enabled = true; } else { syncSwitch.Enabled = false; } } cell.ContentView.AddSubview(syncSwitch); } else { if (indexPath.Section == 0) { cell.TextLabel.Text = "Library Setting"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/server.png"); } else { if (indexPath.Row == 0) { cell.TextLabel.Text = "About eBriefing"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/about.png"); } else if (indexPath.Row == 1) { cell.TextLabel.Text = "Tutorial"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/tutorial.png"); } // else if (indexPath.Row == 2) // { // cell.TextLabel.Text = "Privacy Policy"; // cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/privacy.png"); // } else if (indexPath.Row == 2) { cell.TextLabel.Text = "Give Feedback"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/feedback.png"); } else { cell.TextLabel.Text = "Rate This App"; cell.ImageView.Image = UIImage.FromBundle("Assets/Icons/rate.png"); } } } } catch (Exception ex) { Logger.WriteLineDebugging("PopoverSettingDataSource - GetCell: {0}", ex.ToString()); } return(cell); }