/// <summary> /// Create a contact container /// </summary> private void CreateContactContainerUI(AlertRecipientDTO contact) { if (App.Locator.AlertSOS.LsRecipients.Count == 0) { EmptyDataButton.Hidden = false; return; } else { EmptyDataButton.Hidden = true; } var customView = new UIView(); var sizeUI = (contact.Email.Length > contact.DisplayName.Length ? contact.Email.Length : contact.DisplayName.Length) * 7; var contactNameLable = new UILabel(); contactNameLable.Frame = new RectangleF(3f, 7f, sizeUI, 20f); contactNameLable.Text = contact.DisplayName; contactNameLable.Font = UIFont.FromName("Helvetica", 15f); contactNameLable.TextColor = UIColor.FromRGB(102, 102, 102); var emailLabel = new UILabel(); emailLabel.Frame = new RectangleF(3f, 30f, sizeUI, 20f); emailLabel.Text = contact.Email; emailLabel.Font = UIFont.FromName("Helvetica", 12f); emailLabel.TextColor = UIColor.FromRGB(153, 153, 153); var deleteButton = new UIButton(UIButtonType.RoundedRect); deleteButton.Frame = new RectangleF(sizeUI + 6f, 16f, 25f, 25f);; deleteButton.SetImage(UIImage.FromBundle("Trash"), UIControlState.Normal); deleteButton.Tag = _index; // Delete the content of ScrollView. deleteButton.TouchUpInside += (s, e) => { var index = (int)deleteButton.Tag; App.Locator.AlertSOS.LsRecipients.RemoveAt(index); UpdateScrollViewUI(); SaveButton.Enabled = true; }; customView.AddSubview(contactNameLable); customView.AddSubview(emailLabel); customView.AddSubview(deleteButton); customView.Frame = new RectangleF(_sizeFrame, 0f, sizeUI + 30f, 46f); _sizeFrame += (sizeUI + 30); ScrollViewContact.AddSubview(customView); ScrollViewContact.ContentSize = new CGSize(_sizeFrame, 46f); ScrollViewContact.SetNeedsDisplay(); _index++; }
void ReleaseDesignerOutlets() { if (AddRecipientButton != null) { AddRecipientButton.Dispose(); AddRecipientButton = null; } if (AddRecipientFromContactBookButton != null) { AddRecipientFromContactBookButton.Dispose(); AddRecipientFromContactBookButton = null; } if (AlertMessageTextField != null) { AlertMessageTextField.Dispose(); AlertMessageTextField = null; } if (AlertTitleLabel != null) { AlertTitleLabel.Dispose(); AlertTitleLabel = null; } if (AlertTitleTextField != null) { AlertTitleTextField.Dispose(); AlertTitleTextField = null; } if (EmptyDataButton != null) { EmptyDataButton.Dispose(); EmptyDataButton = null; } if (MaxSizeMessageLabel != null) { MaxSizeMessageLabel.Dispose(); MaxSizeMessageLabel = null; } if (MessageTitleLabel != null) { MessageTitleLabel.Dispose(); MessageTitleLabel = null; } if (RecipientsTitleLabel != null) { RecipientsTitleLabel.Dispose(); RecipientsTitleLabel = null; } if (ScrollViewContact != null) { ScrollViewContact.Dispose(); ScrollViewContact = null; } if (ViewBehindScrollView != null) { ViewBehindScrollView.Dispose(); ViewBehindScrollView = null; } }
void ReleaseDesignerOutlets() { if (AddRecipientButton != null) { AddRecipientButton.Dispose(); AddRecipientButton = null; } if (AddRecipientFromContactBookButton != null) { AddRecipientFromContactBookButton.Dispose(); AddRecipientFromContactBookButton = null; } if (AlertMessageTextField != null) { AlertMessageTextField.Dispose(); AlertMessageTextField = null; } if (AlertTitleLabel != null) { AlertTitleLabel.Dispose(); AlertTitleLabel = null; } if (AlertTitleTextField != null) { AlertTitleTextField.Dispose(); AlertTitleTextField = null; } if (EmptyDataButton != null) { EmptyDataButton.Dispose(); EmptyDataButton = null; } if (MessageTitleLabel != null) { MessageTitleLabel.Dispose(); MessageTitleLabel = null; } if (RecipientsTitleLabel != null) { RecipientsTitleLabel.Dispose(); RecipientsTitleLabel = null; } if (SaveButton != null) { SaveButton.Dispose(); SaveButton = null; } if (ScrollAlertSOS != null) { ScrollAlertSOS.Dispose(); ScrollAlertSOS = null; } if (ScrollViewContact != null) { ScrollViewContact.Dispose(); ScrollViewContact = null; } if (SubTitle11Label != null) { SubTitle11Label.Dispose(); SubTitle11Label = null; } if (SubTitle12Label != null) { SubTitle12Label.Dispose(); SubTitle12Label = null; } if (SubTitle13Label != null) { SubTitle13Label.Dispose(); SubTitle13Label = null; } if (Title1Label != null) { Title1Label.Dispose(); Title1Label = null; } if (Title2Label != null) { Title2Label.Dispose(); Title2Label = null; } if (ViewBehindScrollView != null) { ViewBehindScrollView.Dispose(); ViewBehindScrollView = null; } }
void ReleaseDesignerOutlets() { if (buttonContactSend != null) { buttonContactSend.Dispose(); buttonContactSend = null; } if (pickerViewContactServiceLines != null) { pickerViewContactServiceLines.Dispose(); pickerViewContactServiceLines = null; } if (ScrollViewContact != null) { ScrollViewContact.Dispose(); ScrollViewContact = null; } if (switchContactAcceptCondition != null) { switchContactAcceptCondition.Dispose(); switchContactAcceptCondition = null; } if (textFieldContactMail != null) { textFieldContactMail.Dispose(); textFieldContactMail = null; } if (textFieldContactMessage != null) { textFieldContactMessage.Dispose(); textFieldContactMessage = null; } if (textFieldContactPhoneNumber != null) { textFieldContactPhoneNumber.Dispose(); textFieldContactPhoneNumber = null; } if (textFieldContactUser != null) { textFieldContactUser.Dispose(); textFieldContactUser = null; } if (textFileldContactBusinessName != null) { textFileldContactBusinessName.Dispose(); textFileldContactBusinessName = null; } if (UILabelContactTitle != null) { UILabelContactTitle.Dispose(); UILabelContactTitle = null; } }