Example #1
0
        public override void RegisterDataBinding()
        {
            base.RegisterDataBinding();

            if (_viewModel == null)
            {
                Debug.LogErrorFormat("Binding Error | Could not Find ViewModel {0} for Property {1}", ViewModelName, SrcPropertyName);

                return;
            }
            if (_connection == null)
            {
                _connection = new DataBindingConnection(
                    gameObject, SrcPropertyName.ToBindTarget(_viewModel, true,
                                                             PropertyPath), DstPropertyName.ToBindTarget(_dstView), IConverters);
            }

            _connection.Bind();
        }
        public void RegisterDataBinding(IModel model)
        {
            if (model == null)
            {
                Debug.LogError("No CollectionViewItem on parent. Where did this get spawned");
                enabled = false;
                return;
            }

            if (_connection == null)
            {
                _connection = new DataBindingConnection(gameObject, new BindTarget(model, _srcProp, _srcPath), new BindTarget(_dstView, _dstProp, _dstPath), _converter);
            }

            if (isActiveAndEnabled && !_isBound)
            {
                _connection.Bind();
            }

            _isBound = true;
        }
Example #3
0
 public static void UnRegisterConnection(DataBindingConnection c)
 {
     Connections.Remove(c);
 }
Example #4
0
 public static void RegisterConnection(DataBindingConnection c)
 {
     Connections.Add(c);
 }