/// <inheritedoc /> public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { if (source == null) { var text = (values[0] as ReactTextBox)?.Text; source = AutoCapitalize.Convert(text, culture, (AutoCapitalizeMode)parameter); } return(source); }
/// <summary> /// Returns the view instance for <see cref="ReactTextBox"/>. /// </summary> /// <param name="reactContext"></param> /// <returns></returns> protected override ReactTextBox CreateViewInstance(ThemedReactContext reactContext) { var view = new ReactTextBox { AcceptsReturn = false, }; var binding = AutoCapitalize.GetBinder(AutoCapitalizeMode.Sentences); view.SetBinding(TextBox.TextProperty, binding); return(view); }
/// <inheritedoc /> public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { source = AutoCapitalize.Convert(value as string, culture, (AutoCapitalizeMode)parameter); return(new object[] { null, source }); }
public void SetAutocapitalize(ReactTextBox view, string mode) { var binding = AutoCapitalize.GetBinder(AutoCapitalize.FromString(mode));; view.SetBinding(TextBox.TextProperty, binding); }