Esempio n. 1
0
        public EditTextViewTextBinding(KXObservable observable, TextView textView)
        {
            _observable = observable;
            _textView = textView;

            _subscription = observable.Subscribe();
            _subscription.OnChange = OnModelChange;
            textView.AfterTextChanged += OnViewChange;
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
 public Subscription(KXObservable observable, Action<Subscription> removeAction)
 {
     _observable = observable;
     _removeAction = removeAction;
 }
Esempio n. 4
0
 public TextViewTextBinding(KXObservable observable, TextView textView)
 {
     _subscription = observable.Subscribe();
     _subscription.OnChange = value => textView.Text = value;
 }