public EditTextViewTextBinding(KXObservable observable, TextView textView) { _observable = observable; _textView = textView; _subscription = observable.Subscribe(); _subscription.OnChange = OnModelChange; textView.AfterTextChanged += OnViewChange; }
private void CreateBinding(View view, KXObservable observable) { var editText = view as EditText; if (editText != null) { _bindings.Add(new EditTextViewTextBinding(observable, editText)); return; } var textView = view as TextView; if (textView != null) { _bindings.Add(new TextViewTextBinding(observable, textView)); return; } }
public Subscription(KXObservable observable, Action<Subscription> removeAction) { _observable = observable; _removeAction = removeAction; }
public TextViewTextBinding(KXObservable observable, TextView textView) { _subscription = observable.Subscribe(); _subscription.OnChange = value => textView.Text = value; }