public static UIReturnKeyType GetValueFromDescription(this WEntry.ReturnKeyTypes value) { var type = typeof(UIReturnKeyType); if (!type.IsEnum) { throw new InvalidOperationException(); } foreach (var field in type.GetFields()) { var attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute; if (attribute != null) { if (attribute.Description == value.ToString()) { return((UIReturnKeyType)field.GetValue(null)); } } else { if (field.Name == value.ToString()) { return((UIReturnKeyType)field.GetValue(null)); } } } return(UIReturnKeyType.Default); throw new NotSupportedException($"Not supported on iOS: {value}"); }
public WEntryCell() { ReturnKeyType = WEntry.ReturnKeyTypes.Next; }
public WEntryField() { ReturnKeyType = WEntry.ReturnKeyTypes.Next; HorizontalOptions = LayoutOptions.FillAndExpand; HeightRequest = 40; }