protected VariableBindingProcessor(BindingInfo bindingInfo, Component context) { processedVariable = new ObservableVariable <TTo>(); ViewModel = new OperatorVariableViewModel <TTo>(processedVariable); variableBinding = new VariableBinding <TFrom>(bindingInfo, context); variableBinding.Property.Changed += BoundVariableChangedHandler; }
public VariableBindingSubscriber <T> RegisterVariable <T>(BindingInfo info) { var binding = new VariableBinding <T>(info, context); bindings.Add(binding); return(new VariableBindingSubscriber <T>(binding)); }
protected override void Awake() { base.Awake(); offsetBinding = new VariableBinding <Vector2>(offset, this); offsetBinding.Property.Changed += OnOffsetBindingChanged; }
protected override void Awake() { base.Awake(); textBinding = new VariableBinding <object>(text, this); textBinding.Property.Changed += OnTextBindingPropertyChanged; inputField = GetComponent <TMP_InputField>(); }
protected override void Awake() { base.Awake(); exposedVariable = new ObservableVariable <bool>(); ViewModel = new OperatorVariableViewModel <bool>(exposedVariable); variableBinding = new VariableBinding <object>(variable, this); variableBinding.Property.Changed += OnVariableChanged; variableBinding.Property.Cleared += OnVariableCleared; }
protected virtual void Awake() { result = new ObservableVariable <bool>(); viewModel = new OperatorVariableViewModel <bool>(result); ViewModel = viewModel; operandABinding = new VariableBinding <double>(operandA, this); operandABinding.Property.Changed += OperandChangedHandler; operandBBinding = new VariableBinding <double>(operandB, this); operandBBinding.Property.Changed += OperandChangedHandler; }
protected virtual void Awake() { exposedProperty = new ObservableVariable <string>(); ViewModel = new OperatorVariableViewModel <string>(exposedProperty); formatBinding = new VariableBinding <string>(format, this); formatBinding.Property.Changed += OnFormatChanged; parametersBindingList = new BindingList <object>(this, parameters); parametersBindingList.VariableChanged += OnBindingListVariableChanged; }
protected override void Awake() { base.Awake(); RegisterVariable <T>(source) .OnChanged(OnBoundPropertyChanged) .OnCleared(OnBoundPropertyCleared); initialBinding = new VariableBinding <T>(InitialValue, this); exposedProperty = new ObservableVariable <T>(); ViewModel = new OperatorVariableViewModel <T>(exposedProperty); }
protected override void Awake() { base.Awake(); exposedCommand = new ObservableCommand(); exposedCommand.ExecuteRequested += OnExposedCommandExecuteRequested; ViewModel = new CommandViewModel(exposedCommand); commandBinding = new CommandBinding <T>(commandBindingInfo, this); commandBinding.Property.CanExecute.Changed += OnCommandCanExecuteChanged; decorationBinding = new VariableBinding <T>(DecorationBindingInfo, this); }
public BindingList(Component context, BindingInfoList infoList) { bindingList = new List <VariableBinding <T> >(); values = new List <T>(); for (int i = 0; i < infoList.BindingInfos.Count; i++) { BindingInfo current = infoList.BindingInfos[i]; var newVariable = new VariableBinding <T>(current, context); int index = i; newVariable.Property.Changed += newValue => OnBoundVariableChanged(index, newValue); bindingList.Add(newVariable); values.Add(newVariable.Property.GetValue(default));
protected virtual void Awake() { binding = new VariableBinding <object>(bindingInfo, this); binding.Property.Changed += SetData; }
protected override void Awake() { base.Awake(); fallbackBinding = new VariableBinding <TTo>(Fallback, this); }