Class DesignElement

    Definition

    Namespace:
    Tizen.Applications.WatchfaceComplication
    Assembly:
    Tizen.Applications.WatchfaceComplication.dll

    Represents the design element for a watch application.

    public abstract class DesignElement : IEditable
    Inheritance
    object
    DesignElement
    Implements
    IEditable

    Constructors

    View Source

    DesignElement(IEnumerable<Bundle>, int, string)

    Initializes a new instance of the DesignElement class.

    Declaration
    protected DesignElement(IEnumerable<Bundle> candidates, int currentDataIndex, string editableName)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T><Bundle> candidates

    The candidates list.

    int currentDataIndex

    The index of selected data among candidate list.

    string editableName

    The design element name.

    Examples
    public class ColorDesign : DesignElement
    {
        private Button _layout;
        private static string _colorKey = "TEST_COLOR";
        public ColorDesign(IEnumerable candidates, int curDataIdx, string editableName, Button layout)
            : base(candidates, curDataIdx, editableName)
        {
            _layout = layout;
        }
        protected override void OnDesignUpdated(int selectedIdx, State state)
        {
            int idx = 0;
            string color = "";
            foreach (Bundle candidate in this.Candidates)
            {
                if (idx++ != selectedIdx)
                    continue;
                color = candidate.GetItem(_colorKey);
                break;
            }
            Log.Warn(_logTag, "Color : " + color);
            if (color.Equals("YELLOW"))
            {
                _layout.BackgroundColor = Color.Yellow;
            }
       }
    }
    
    List<Bundle> candidatesList = new List<Bundle>();
    data = new Bundle();
    data.AddItem(_colorKey, "RED");
    candidatesList.Add(data);
    data.AddItem(_colorKey, "BLUE");
    candidatesList.Add(data);
    ColorDesign colorEdit = new ColorDesign(candidatesList, curIdx, "COLOR", _complicationBtn);
    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when e is invalid.

    System.InvalidOperationException

    Thrown when the method failed due to invalid operation.

    System.NotSupportedException

    Thrown when the watchface complication is not supported.

    Properties

    View Source

    Candidates

    The information of Editable candidates.

    Declaration
    public IEnumerable<Bundle> Candidates { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<T><Bundle>
    View Source

    Highlight

    The information of design element's highlight.

    Declaration
    public Highlight Highlight { get; set; }
    Property Value
    Type Description
    Highlight

    Methods

    View Source

    OnDesignUpdated(int, State)

    Overrides this method to handle the behavior when the design element is updated.

    Declaration
    protected abstract void OnDesignUpdated(int selectedIdx, State state)
    Parameters
    Type Name Description
    int selectedIdx

    The selected candidate index.

    State state

    The update state.

    Explicit Interface Implementations

    View Source

    IEditable.EditableId

    The information of Editable ID.

    Declaration
    int IEditable.EditableId { get; set; }
    Returns
    Type Description
    int
    View Source

    IEditable.GetCurrentData()

    Gets the editable's currently selected data.

    Declaration
    Bundle IEditable.GetCurrentData()
    Returns
    Type Description
    Bundle

    The currently selected data.

    View Source

    IEditable.GetCurrentDataIndex()

    Gets the editable's currently selected data index of candidate list.

    Declaration
    int IEditable.GetCurrentDataIndex()
    Returns
    Type Description
    int

    The index of selected data among candidate list.

    View Source

    IEditable.Highlight

    The information of editable's highlight.

    Declaration
    Highlight IEditable.Highlight { get; set; }
    Returns
    Type Description
    Highlight
    View Source

    IEditable.Name

    The information of Editable name.

    Declaration
    string IEditable.Name { get; set; }
    Returns
    Type Description
    string

    Implements

    IEditable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX