Example #1
0
        private void SanitizeTypes()
        {
            bool didTypeChange = false;

            if (bindingType == BindingType.Variable && fromBinding.Type != typeof(IReadOnlyObservableVariable <TFrom>))
            {
                fromBinding   = new BindingInfo(typeof(IReadOnlyObservableVariable <TFrom>));
                expectedType  = new SerializableType(typeof(OperatorVariableViewModel <TTo>));
                didTypeChange = true;
            }

            if (bindingType == BindingType.Collection && fromBinding.Type != typeof(IReadOnlyObservableCollection <TFrom>))
            {
                fromBinding   = new BindingInfo(typeof(IReadOnlyObservableCollection <TFrom>));
                expectedType  = new SerializableType(typeof(OperatorCollectionViewModel <TTo>));
                didTypeChange = true;
            }

            if (bindingType == BindingType.Command && fromBinding.Type != typeof(IObservableCommand <TTo>))
            {
                fromBinding   = new BindingInfo(typeof(IObservableCommand <TTo>));
                expectedType  = new SerializableType(typeof(OperatorCommandViewModel <TFrom>));
                didTypeChange = true;
            }

            if (bindingType == BindingType.Event && fromBinding.Type != typeof(IObservableEvent <TFrom>))
            {
                fromBinding   = new BindingInfo(typeof(IObservableEvent <TFrom>));
                expectedType  = new SerializableType(typeof(OperatorEventViewModel <TTo>));
                didTypeChange = true;
            }

            if (didTypeChange)
            {
                BindingInfoTrackerProxy.RefreshBindingInfo();
            }
        }
Example #2
0
 public BindingInfoList(Type type)
 {
     this.type = new SerializableType(type);
 }