Class DesignElement

Definition

Namespace:
Tizen.Applications.WatchfaceComplication
Assembly:
Tizen.Applications.WatchfaceComplication.dll
API Level:
6

Represents the design element for a watch application.

C#
Copy
public abstract class DesignElement : IEditable
Inheritance
System.Object
DesignElement
Implements

Constructors

View Source

DesignElement(IEnumerable<Bundle>, Int32, String)

Initializes a new instance of the DesignElement class.

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

The candidates list.

Int32 currentDataIndex

The index of selected data among candidate list.

System.String editableName

The design element name.

Examples
Copy
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.

API Level: 6

Properties

View Source

Candidates

The information of Editable candidates.

Declaration
C#
Copy
public IEnumerable<Bundle> Candidates { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<Bundle>
API Level: 6
View Source

Highlight

The information of design element's highlight.

Declaration
C#
Copy
public Highlight Highlight { get; set; }
Property Value
Type Description
Highlight
API Level: 6

Methods

View Source

OnDesignUpdated(Int32, State)

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

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

The selected candidate index.

State state

The update state.

API Level: 6

Explicit Interface Implementations

View Source

IEditable.EditableId

The information of Editable ID.

Declaration
C#
Copy
int IEditable.EditableId { get; set; }
Returns
Type Description
Int32
API Level: 6
View Source

IEditable.GetCurrentData()

Gets the editable's currently selected data.

Declaration
C#
Copy
Bundle IEditable.GetCurrentData()
Returns
Type Description
Bundle

The currently selected data.

API Level: 6
View Source

IEditable.GetCurrentDataIndex()

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

Declaration
C#
Copy
int IEditable.GetCurrentDataIndex()
Returns
Type Description
Int32

The index of selected data among candidate list.

API Level: 6
View Source

IEditable.Highlight

The information of editable's highlight.

Declaration
C#
Copy
Highlight IEditable.Highlight { get; set; }
Returns
Type Description
Highlight
API Level: 6
View Source

IEditable.Name

The information of Editable name.

Declaration
C#
Copy
string IEditable.Name { get; set; }
Returns
Type Description
System.String
API Level: 6

Implements