示例#1
0
        Cell CreateTintColorCell(string colorName, Color colorValue, CellGlossAccessoryType accessoryType)
        {
            Cell result;

            if (accessoryType == CellGlossAccessoryType.EditIndicator)
            {
                result = new EntryCell();
                (result as EntryCell).Label                   = colorName;
                (result as EntryCell).Placeholder             = "Optional";
                (result as EntryCell).HorizontalTextAlignment = TextAlignment.End;
            }
            else
            {
                result = new TextCell();
                (result as TextCell).Text = colorName;
            }

            // Instantiate an instance of the Gloss properties you want to assign values to
            var gloss = new CellGloss(result);

            gloss.TintColor     = colorValue;
            gloss.AccessoryType = accessoryType;

            return(result);
        }
示例#2
0
 /// <summary>
 /// Sets the passed <see cref="T:XFGloss.CellGlossAccessoryType"/> value as the currently assigned accessory type for
 /// the passed <see cref="T:Xamarin.Forms.BindableObject"/>.
 /// </summary>
 /// <param name="bindable">The <see cref="T:Xamarin.Forms.BindableObject"/> that the AccessoryType attached
 /// property value should be assigned to.</param>
 /// <param name="value">The <see cref="T:XFGloss.CellGlossAccessoryType"/> that should be assigned to the passed
 /// <see cref="T:Xamarin.Forms.BindableObject"/>.</param>
 public static void SetAccessoryType(BindableObject bindable, CellGlossAccessoryType value)
 {
     bindable?.SetValue(AccessoryTypeProperty, value);
 }