public void UpdateTextView(TData data)
            {
                if (_inputCount > 0)
                {
                    return;
                }

                string text = _converter.ConvertOutput(_output());

                _outputCount++;
                try
                {
                    _control.Text = text;
                }
                finally
                {
                    _outputCount--;
                }
            }
 /// <summary>
 /// Bind the Value property of a UIStepper to a property using a value converter.
 /// </summary>
 /// <param name="bindings">The binding manager.</param>
 /// <param name="control">The stepper.</param>
 /// <param name="output">A function that gets the property.</param>
 /// <param name="input">An action sets the property.</param>
 /// <param name="converter">A custom value converter to type double.</param>
 /// <typeparam name="TData">The type of property to which the value is bound.</typeparam>
 public static void BindValue <TData>(this BindingManager bindings, UIStepper control, Func <TData> output, Action <TData> input, IDisplayDataConverter <double, TData> converter)
 {
     bindings.Bind(output, s => control.Value = converter.ConvertOutput(s), new ValueBinding <TData>(control, input, converter));
 }
Пример #3
0
 /// <summary>
 /// Bind the Text of a UITextField to a property using a value converter.
 /// </summary>
 /// <param name="bindings">The binding manager.</param>
 /// <param name="control">The text field.</param>
 /// <param name="output">A function that gets the property.</param>
 /// <param name="input">A function that sets the property.</param>
 /// <param name="converter">A custom value converter to string.</param>
 /// <typeparam name="TData">The type of the property.</typeparam>
 public static void BindText <TData>(this BindingManager bindings, UITextField control, Func <TData> output, Action <TData> input, IDisplayDataConverter <string, TData> converter)
 {
     bindings.Bind(output, s => control.Text = converter.ConvertOutput(s), new TextBinding <TData>(control, input, converter));
 }
 /// <summary>
 /// Bind the text of a text view to a read-only property using a value converter.
 /// </summary>
 /// <param name="bindings">The binding manager.</param>
 /// <param name="control">The label.</param>
 /// <param name="output">A function that gets the property.</param>
 /// <param name="converter">A custom value converter to string.</param>
 /// <typeparam name="TData">The type of the property.</typeparam>
 public static void BindText <TData>(this BindingManager bindings, TextView control, Func <TData> output, IDisplayDataConverter <string, TData> converter)
 {
     bindings.Bind(
         output,
         data => control.Text = converter.ConvertOutput(data));
 }
Пример #5
0
 /// <summary>
 /// Bind the Text of a UILabel to a read-only property using a value converter.
 /// </summary>
 /// <param name="bindings">The binding manager.</param>
 /// <param name="control">The label.</param>
 /// <param name="output">A function that gets the property.</param>
 /// <param name="converter">A custom value converter to string.</param>
 /// <typeparam name="TData">The type of the property.</typeparam>
 public static void BindText <TData>(this BindingManager bindings, UILabel control, Func <TData> output, IDisplayDataConverter <string, TData> converter)
 {
     bindings.Bind(output, s => control.Text = converter.ConvertOutput(s));
 }