ContactPicker Component


Properties

backgroundColor
  Specifies the ContactPicker's background color as an red-green-blue-alpha RRGGBBAA or red-green-blue RRGGBB string. If an Image has been set, the color change will not be visible until the Image is removed.
Data type: color
Designer Writable true <contactpicker name="contactpickerName" backgroundColor="FF0aa8b1">
Code Writeable true contactpickerName.backgroundColor = "FF0aa8b1"
Code Readable true let variable = contactpickerName.backgroundColor

contactName
  Returns the full name of the selected contact, or the empty string if a name is unavailable.
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.contactName

contactUri
  Returns a URI that specifies the location of the contact on the device.
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.contactUri

emailAddress
  Returns the primary email address of the selected contact, or the empty string if an email address is unavailable.
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.emailAddress

emailAddressList
  Returns a list of email addresses associated with the selected contact.
Data type: array
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.emailAddressList

enabled
  Specifies whether the ContactPicker should be active and clickable.
Data type: boolean
Designer Writable true <contactpicker name="contactpickerName" enabled="true">
Code Writeable true contactpickerName.enabled = true
Code Readable true let variable = contactpickerName.enabled

fontBold
  Specifies whether the text of the ContactPicker should be bold. Some fonts do not support bold.
Data type: boolean
Designer Writable true <contactpicker name="contactpickerName" fontBold="true">
Code Writeable true contactpickerName.fontBold = true
Code Readable true let variable = contactpickerName.fontBold

fontItalic
  Specifies whether the text of the ContactPicker should be italic. Some fonts do not support italic.
Data type: boolean
Designer Writable true <contactpicker name="contactpickerName" fontItalic="true">
Code Writeable true contactpickerName.fontItalic = true
Code Readable true let variable = contactpickerName.fontItalic

fontSize
  Specifies the text font size of the ContactPicker, measured in sp(scale-independent pixels).
Data type: number
Designer Writable true <contactpicker name="contactpickerName" fontSize="24">
Code Writeable true contactpickerName.fontSize = 24
Code Readable true let variable = contactpickerName.fontSize

fontTypeface
  Specifies the text font face of the ContactPicker as 'serif', 'sans serif', or 'monospace'.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" fontTypeface="monospace">
Code Writeable false
Code Readable false

height
  Specifies the ContactPicker's vertical height, measured in pixels.
Data type: number
Designer Writable false
Code Writeable true contactpickerName.height = 180
Code Readable true let variable = contactpickerName.height

heightPercent
  Specifies the ContactPicker's vertical height as a percentage of the Screen's Height.
Data type: number
Designer Writable false
Code Writeable true contactpickerName.heightPercent = 25
Code Readable false

image
  Specifies the path of the ContactPicker's image. If there is both an Image and a BackgroundColor specified, only the Image will be visible.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" image="cat.png">
Code Writeable true contactpickerName.image = "cat.png"
Code Readable true let variable = contactpickerName.image

phoneNumber
  Returns the primary phone number associated with the selected contact, or the empty string if no phone number is associated with the contact.
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.phoneNumber

phoneNumberList
  Returns a list of phone numbers associated with the selected contact.
Data type: array
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.phoneNumberList

picture
  Returns a picture URI for the selected contact, which can be used to retrieve the contact's photo and other fields.
Data type: string
Designer Writable false
Code Writeable false
Code Readable true let variable = contactpickerName.picture

shape
  Specifies the shape of the ContactPicker. The valid values for this property are'round', 'rectangle' and 'oval'. The Shape will not be visible if an Image is used.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" shape="oval">
Code Writeable false
Code Readable false

showFeedback
  Specifies if a visual feedback should be shown when a ContactPicker with an assigned Image is pressed.
Data type: boolean
Designer Writable true <contactpicker name="contactpickerName" showFeedback="true">
Code Writeable true contactpickerName.showFeedback = true
Code Readable true let variable = contactpickerName.showFeedback

text
  Specifies the text displayed by the ContactPicker.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" text="Test text">
Code Writeable true contactpickerName.text = "Test text"
Code Readable true let variable = contactpickerName.text

textAlignment
  Specifies the alignment of the ContactPicker's text. Valid values are 'left', 'right' and 'center'.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" textAlignment="center">
Code Writeable false
Code Readable false

textColor
  Specifies the text color of the ContactPicker as an red-green-blue-alpha RRGGBBAA or red-green-blue RRGGBB string.
Data type: color
Designer Writable true <contactpicker name="contactpickerName" textColor="FF890594">
Code Writeable true contactpickerName.textColor = "FF890594"
Code Readable true let variable = contactpickerName.textColor

visible
  Specifies whether the ContactPicker should be visible on the screen. Value is true{
Data type: boolean
Designer Writable true <contactpicker name="contactpickerName" visible="true">
Code Writeable true contactpickerName.visible = true
Code Readable true let variable = contactpickerName.visible

width
  Specifies the horizontal width of the ContactPicker, measured in pixels.
Data type: number
Designer Writable false
Code Writeable true contactpickerName.width = 300
Code Readable true let variable = contactpickerName.width

widthPercent
  Specifies the horizontal width of the ContactPicker as a percentage of the Screen's Width.
Data type: number
Designer Writable false
Code Writeable true contactpickerName.widthPercent = 85
Code Readable false

class
  The styling class of the the component
Data type: string
Designer Writable true <contactpicker name="contactpickerName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <contactpicker name="contactpickerName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <contactpicker name="contactpickerName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
open Opens the ContactPicker, as though the user clicked on it.
contactpickerName.open()
viewContact Opens the selected contact's entry in the device's default Contacts app.
contactpickerName.viewContact(uri)
contactpickerName.viewContact("Test uri")
uri string
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
afterPicking Event to be raised after the ContactPicker activity returns its result and the properties have been filled in.
contactpickerName.addEventListener(
    "afterPicking",
    function () {
        //Your code here
    }
)
beforePicking Event to raise when the ContactPicker is clicked or the picker is shown using the Open method. This event occurs before the picker is displayed, and can be used to prepare the picker before it is shown.
contactpickerName.addEventListener(
    "beforePicking",
    function () {
        //Your code here
    }
)
gotFocus Indicates the cursor moved over the ContactPicker so it is now possible to click it.
contactpickerName.addEventListener(
    "gotFocus",
    function () {
        //Your code here
    }
)
lostFocus Indicates the cursor moved away from the ContactPicker so it is now no longer possible to click it.
contactpickerName.addEventListener(
    "lostFocus",
    function () {
        //Your code here
    }
)
touchDown Indicates that the ContactPicker was pressed down.
contactpickerName.addEventListener(
    "touchDown",
    function () {
        //Your code here
    }
)
touchUp Indicates that the ContactPicker has been released.
contactpickerName.addEventListener(
    "touchUp",
    function () {
        //Your code here
    }
)