Exemplo n.º 1
0
        private View GetView(EditableText item, View convertView)
        {
            var editableCell = convertView as EditableTextCell ?? new EditableTextCell(this);

            editableCell.Bind(item);

            return(editableCell);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Bind the specified editableText.
        /// </summary>
        /// <param name="editableText">Editable text.</param>
        public void Bind(EditableText editableText)
        {
            if (this.editableText != null)
            {
                this.editableText.PropertyChanged -= HandlePropertyChanged;
                this.switchCheck.CheckedChange -= HandleValueChanged;
                this.textField.AfterTextChanged -= HandleEditingChanged;
            }

            this.textField.Text = editableText.Text;
            this.switchCheck.Checked = this.textField.Enabled =  editableText.Checked;

            this.editableText = editableText;
            this.editableText.PropertyChanged += HandlePropertyChanged;

            this.switchCheck.CheckedChange += HandleValueChanged;
            this.textField.AfterTextChanged += HandleEditingChanged;
        }
Exemplo n.º 3
0
        public void Bind(EditableText editableText)
        {
            this.textField.Text = editableText.Text;
            this.switchCheck.On = editableText.Checked;

            if (this.editableText != null)
            {
                this.editableText.PropertyChanged -= HandlePropertyChanged;
                this.switchCheck.ValueChanged     -= HandleValueChanged;
                this.textField.EditingChanged     -= HandleEditingChanged;
            }

            this.editableText = editableText;
            this.editableText.PropertyChanged += HandlePropertyChanged;

            this.switchCheck.ValueChanged += HandleValueChanged;
            this.textField.EditingChanged += HandleEditingChanged;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Bind the specified editableText.
        /// </summary>
        /// <param name="editableText">Editable text.</param>
        public void Bind(EditableText editableText)
        {
            if (this.editableText != null)
            {
                this.editableText.PropertyChanged -= HandlePropertyChanged;
                this.switchCheck.CheckedChange    -= HandleValueChanged;
                this.textField.AfterTextChanged   -= HandleEditingChanged;
            }

            this.textField.Text      = editableText.Text;
            this.switchCheck.Checked = this.textField.Enabled = editableText.Checked;

            this.editableText = editableText;
            this.editableText.PropertyChanged += HandlePropertyChanged;

            this.switchCheck.CheckedChange  += HandleValueChanged;
            this.textField.AfterTextChanged += HandleEditingChanged;
        }
Exemplo n.º 5
0
        public void Bind(EditableText editableText)
        {
            this.textField.Text = editableText.Text;
            this.switchCheck.On = editableText.Checked;

            if (this.editableText != null)
            {
                this.editableText.PropertyChanged -= HandlePropertyChanged;
                this.switchCheck.ValueChanged -= HandleValueChanged;
                this.textField.EditingChanged -= HandleEditingChanged;
            }

            this.editableText = editableText;
            this.editableText.PropertyChanged += HandlePropertyChanged;

            this.switchCheck.ValueChanged += HandleValueChanged;
            this.textField.EditingChanged += HandleEditingChanged;

        }
Exemplo n.º 6
0
 public void AddItem(EditableText item)
 {
     this.Items.Add(item);
     item.PropertyChanged += HandlePropertyChanged;
 }
Exemplo n.º 7
0
 public EditableTextViewModel()
 {
     this.Items             = new ObservableDataSource <EditableText> ();
     this.latestTextChange  = new EditableText();
     this.latestCheckChange = new EditableText();
 }
 public void AddItem(EditableText item)
 {
     this.Items.Add (item);
     item.PropertyChanged += HandlePropertyChanged;
 }
 public EditableTextViewModel ()
 {
     this.Items = new ObservableDataSource<EditableText> ();
     this.latestTextChange = new EditableText ();
     this.latestCheckChange = new EditableText ();
 }
Exemplo n.º 10
0
        private View GetView (EditableText item, View convertView)
        {
            var editableCell = convertView as EditableTextCell ?? new EditableTextCell(this);

            editableCell.Bind (item);

            return editableCell;
        }