Exemplo n.º 1
0
        public void Bind(object newValue)
        {
            if (this.binder == null)
            {
                throw BindingException.FromField(this, "Field is not bindable.");
            }

            try
            {
                this.binder((TValue)newValue);
                this.Value = newValue;
            }
            catch (NotIndexableException)
            {
                throw BindingException.FromField(this, "Property has no indexer.");
            }
            catch (NotWritableException)
            {
                throw BindingException.FromField(this, "Property has no setter.");
            }
            catch (Exception ex)
            {
                throw BindingException.FromField(this, innerException: ex);
            }
        }
Exemplo n.º 2
0
 public void Bind(object newValue) => throw BindingException.FromField(this, "Missing fields are not bindable due to a null container.");
Exemplo n.º 3
0
 public void Bind(object newValue) => throw BindingException.FromField(this, "Models are not not bindable due to having no container.");